gpt4 book ai didi

r - 在 Windows 上安装 rjags 包

转载 作者:行者123 更新时间:2023-12-05 07:52:46 28 4
gpt4 key购买 nike

在 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\3.2”

当我尝试安装 rjags 时,R 显示如下,我无法将已安装的 rjags 加载到我的 R 中。

Installing package into ‘C:/Users/AA/Desktop/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)

我该如何解决这个问题?

编辑以反射(reflect)评论:加载库 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 lastweek. If you go to the project page on Sourceforge then you should seean appropriate download link for your platform (binary packages forWindows and Mac OS X; source tarball for other platforms). Binarypackages are also available for some Linux distributions. See the JAGShomepage 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 longersupported.

The rjags package for R has been updated to work with the new releaseof JAGS. It is not yet uploaded to CRAN, and the version of rjags thatis available on CRAN (rjags_3-15) does not work with JAGS 4.0.0.However, you can download rjags_4-3 from Sourceforge. Again, binarypackages are available for Windows (.zip) and Mac OS X (.tgz).

关于r - 在 Windows 上安装 rjags 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33268990/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com