简体   繁体   中英

How can I ensure that I install compatible versions of JAGS and rjags in Ubuntu?

I would like to write a script that installs JAGS and rjags on a new ubuntu installation, and that will work independently of the currently available versions of these packages. I'd like to know how I can do this while avoiding conflicts between versions.

I have the following R script, initialize.R :

system('apt-get install jags') 
install.packages('rjags')

So that I can run from bash:

sudo R --vanilla < initialize.R

However, the most recent version of JAGS in the Ubuntu repository is 2.2, and the version of rjags available from CRAN depends on JAGS > 3.0.

I am interested in installing compatable JAGS and rjags , perhaps either:

  1. installing a specific version of JAGS (eg 2.2) and the compatable rjags version (which version?)
  2. generically installing the version of JAGS currently in the ubuntu repository and the appropriate rjags version, or
  3. generically installing the most recent version of rjags at cran and the appropriate version of JAGS

The ability to do case 1 is essential, but am also curious how I could implement cases 2 and/or 3.

questions:

  • How can I do this?
  • Is there a more sound approach?

update: following link in Dirk's answer, the following worked:

add-apt-repository ppa:marutter/rrutter
apt-get update
apt-get install r-cran-rjags 

Michael Rutter provides an r-cran-rjags package via his repository; this works with the jags package you already have installed. See this message on r-sig-devel for details, and you may want to subscribe to and follow the r-sig-debian list to stay abreast of these things.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM