I would like to write a script that installs JAGS and rjags on a new ubuntu installation and will work regardless of the currently available versions of these packages. I would like to know how I can do this, avoiding conflicts between versions.
I have the following R script, initialize.R :
system('apt-get install jags') install.packages('rjags')
So that I can work from bash:
sudo R --vanilla < initialize.R
However, the latest version of JAGS in the Ubuntu repository is 2.2, and the rjags version available from CRAN depends on JAGS> 3.0.
I am interested in installing compatible JAGS and rjags , perhaps either:
- installing a specific version of JAGS (e.g. 2.2) and a compatible version of rjags (which version?)
- general installation of the JAGS version currently in the ubuntu repository and corresponding version of rjags or
- general installation of the latest version of rjags in the crane and the corresponding version of JAGS
The ability to do case 1 is important, but I'm also curious how I can implement cases 2 and / or 3.
questions:
- How can i do this?
- Is there a more reasonable approach?
update: the following link in Dirk's answer: worked:
add-apt-repository ppa:marutter/rrutter apt-get update apt-get install r-cran-rjags
source share