While installing Jags 4.0 and rjags
package in R, it seems there is a problem in matching library between Jags4.0 and "rjags" packages.
I first installed Jags 4.0 into "C:\Program Files\JAGS\JAGS-4.0.0" and then I tried to install rjags packages with R
install.packages("rjags")
My default package library is : "C:\Users\AA\Desktop\Documents\R\win-library\3.2"
When I tried to install rjags
, R shows below, and I cannot load installed rjags into my R.
Installing package into ‘C:/Users/AA/Desktop/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
How should I solve this problem?
Edit to reflect the comments:
Loading library library(rjags)
results in the following error:
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’
For reference in case someone is looking for the same issue, I collected the comments made by @Benjamin and @BoramLim in an answer.
There is a version difference between the jags installer (version 4.0) and rjags on cran which for now depends on jags version 3.x. You can find a working version of rjags on Sourceforge.
Release notes from 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).