如何确保在 Ubuntu 中安装兼容版本的 JAGS 和 rjags?
我想编写一个脚本,在新的 ubuntu 安装上安装 JAGS 和 rjags,并且该脚本将独立于这些软件包的当前可用版本运行。我想知道如何做到这一点,同时避免版本之间的冲突。
我有以下 R 脚本,initialize.R
:
system('apt-get install jags')
install.packages('rjags')
这样我就可以从 bash 运行:
sudo R --vanilla < initialize.R
但是,Ubuntu 存储库中 JAGS 的最新版本是 2.2,并且 CRAN 提供的 rjags 取决于 JAGS > 3.0。
我有兴趣安装兼容的 JAGS
和 rjags
,也许是:
- 安装特定版本的 JAGS(例如 2.2)和兼容的 rjags 版本(哪个版本?
- )当前在 ubuntu 存储库中的 JAGS 版本和适当的 rjags 版本,或者
- 通常在 cran 处安装最新版本的 rjags 和适当的 JAGS 版本
执行情况 1 的能力是很重要,但我也很好奇如何实现案例 2 和/或 3。
问题
- 我该如何做到这一点?
- 有没有更稳妥的方法?
更新:按照德克回答中的链接,以下内容有效:
add-apt-repository ppa:marutter/rrutter
apt-get update
apt-get install r-cran-rjags
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:
- installing a specific version of JAGS (e.g. 2.2) and the compatable rjags version (which version?)
- generically installing the version of JAGS currently in the ubuntu repository and the appropriate rjags version, or
- 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Michael Rutter 通过他的存储库提供了一个 r-cran-rjags 包;这适用于您已经安装的 jag 软件包。请参阅r-sig-devel 上的此消息有关详细信息,您可能需要订阅并关注 r-sig-debian 列表以随时了解这些内容。
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.