似乎 runjags 突然(更新到版本 2.0.3-2 后)找不到 JAGS 二进制文件,发出错误:
[1] "Error in system(\"where jags\", intern = TRUE) : 'where' not found\n"
attr(,"class")
[1] "try-error"
attr(,"condition")
<simpleError in system("where jags", intern = TRUE): 'where' not found
我通过将这条线放在我的Rprofile
:
.runjags.options <- list(jagspath = "c:/Program Files/JAGS/JAGS-4.2.0/i386/bin/jags-terminal.exe")
这几乎可以解决问题(尽管它并不理想——以前版本的 runjags 可以自动找到二进制文件)。
但是,当通过打开与其关联的 .Rdata 文件启动 Rgui(在 Windows XP 中)时,它会停止工作:
> .runjags.options # it was set in the Rprofile
$jagspath
[1] "c:/Program Files/JAGS/JAGS-4.2.0/i386/bin/jags-terminal.exe"
> require(runjags)
Loading required package: runjags
Warning message:
package ‘runjags’ was built under R version 3.1.3
> runjags.getOption("jagspath")
[1] "Error in system(\"where jags\", intern = TRUE) : 'where' not found\n"
attr(,"class")
[1] "try-error"
attr(,"condition")
<simpleError in system("where jags", intern = TRUE): 'where' not found
这是一个错误吗?如何解决这个问题?
我目前正在调用runjags.options(jagspath = "c:/Program Files/JAGS/JAGS-4.2.0/i386/bin/jags-terminal.exe")
我的消息来源require(runjags)
,但我想尽可能避免这种情况!