How to load rjags

2019-05-18 11:21发布

问题:

As with a lot of other people, I have issues loading and installing rjags.

I get the error:

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
http://www.sourceforge.net/projects/mcmc-jags/files

Error: package or namespace load failed for ‘rjags’

I am running R 3.2.2 on a PC (Windows 10), and have the JAGS programme installed at: C:\Program Files\JAGS\JAGS-4.0.0

Is there a way to convince R that JAGS is really, truly and honestly, installed? I even have it open in the background?

Any assistance would be greatly appreciated.

回答1:

I have solved the problem. It appears that rjags is not compatible with JAGS 4.0, you can install JAGS 3.0 at the following address: http://sourceforge.net/projects/mcmc-jags/files/JAGS/3.x/Windows/



回答2:

Although it is not yet on CRAN, you can download the rjags packages for JAGS 4.0.0 from here http://sourceforge.net/projects/mcmc-jags/files/rjags/4/



标签: r jags