在 windows 上安装 rjags 软件包
Installing rjags packages on windows
在 R 中安装 Jags 4.0 和 rjags
包时,Jags4.0 和 "rjags" 包之间的匹配库似乎有问题。
我首先将 Jags 4.0 安装到 "C:\Program Files\JAGS\JAGS-4.0.0" 中,然后尝试使用 R
安装 rjags 包
install.packages("rjags")
我的默认包库是:"C:\Users\AA\Desktop\Documents\R\win-library.2"
当我尝试安装 rjags
时,R 显示如下,我无法将已安装的 rjags 加载到我的 R 中。
Installing package into ‘C:/Users/AA/Desktop/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
我该如何解决这个问题?
编辑以反映评论:
加载库 library(rjags)
导致以下错误:
Error : .onLoad failed in loadNamespace() for 'rjags', details: call:
fun(libname, pkgname) error: Failed to locate any version of JAGS
version 3 The rjags package is just an interface to the JAGS library
Make sure you have installed JAGS-3.0.0.exe or higher from
sourceforge.net/projects/mcmc-jags/files Error: package or namespace
load failed for ‘rjags’
如果有人正在寻找相同的问题,以供参考,我收集了@Benjamin 和@BoramLim 在答案中发表的评论。
总结:
jags 安装程序(4.0 版)和 cran 上的 rjags 之间存在版本差异,目前取决于 jags 版本 3.x。您可以在 Sourceforge 上找到 rjags 的工作版本。
来自 blog
的发行说明
After a long gestation period, JAGS 4.0.0 was finally released last
week. If you go to the project page on Sourceforge then you should see
an appropriate download link for your platform (binary packages for
Windows and Mac OS X; source tarball for other platforms). Binary
packages are also available for some Linux distributions. See the JAGS
homepage for details.
Mac users should note that you need OS X 10.9 or later (i.e.
Mavericks, Yosemite, or El Capitan). Older releases are no longer
supported.
The rjags package for R has been updated to work with the new release
of JAGS. It is not yet uploaded to CRAN, and the version of rjags that
is available on CRAN (rjags_3-15) does not work with JAGS 4.0.0.
However, you can download rjags_4-3 from Sourceforge. Again, binary
packages are available for Windows (.zip) and Mac OS X (.tgz).
在 R 中安装 Jags 4.0 和 rjags
包时,Jags4.0 和 "rjags" 包之间的匹配库似乎有问题。
我首先将 Jags 4.0 安装到 "C:\Program Files\JAGS\JAGS-4.0.0" 中,然后尝试使用 R
install.packages("rjags")
我的默认包库是:"C:\Users\AA\Desktop\Documents\R\win-library.2"
当我尝试安装 rjags
时,R 显示如下,我无法将已安装的 rjags 加载到我的 R 中。
Installing package into ‘C:/Users/AA/Desktop/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
我该如何解决这个问题?
编辑以反映评论:
加载库 library(rjags)
导致以下错误:
Error : .onLoad failed in loadNamespace() for 'rjags', details: call: fun(libname, pkgname) error: Failed to locate any version of JAGS version 3 The rjags package is just an interface to the JAGS library Make sure you have installed JAGS-3.0.0.exe or higher from sourceforge.net/projects/mcmc-jags/files Error: package or namespace load failed for ‘rjags’
如果有人正在寻找相同的问题,以供参考,我收集了@Benjamin 和@BoramLim 在答案中发表的评论。
总结:
jags 安装程序(4.0 版)和 cran 上的 rjags 之间存在版本差异,目前取决于 jags 版本 3.x。您可以在 Sourceforge 上找到 rjags 的工作版本。
来自 blog
的发行说明After a long gestation period, JAGS 4.0.0 was finally released last week. If you go to the project page on Sourceforge then you should see an appropriate download link for your platform (binary packages for Windows and Mac OS X; source tarball for other platforms). Binary packages are also available for some Linux distributions. See the JAGS homepage for details.
Mac users should note that you need OS X 10.9 or later (i.e. Mavericks, Yosemite, or El Capitan). Older releases are no longer supported.
The rjags package for R has been updated to work with the new release of JAGS. It is not yet uploaded to CRAN, and the version of rjags that is available on CRAN (rjags_3-15) does not work with JAGS 4.0.0. However, you can download rjags_4-3 from Sourceforge. Again, binary packages are available for Windows (.zip) and Mac OS X (.tgz).