Developer
Developer

Reputation: 976

Installing rjags, on Mac El capitan 10.11.4

I recive some error when trying to load the rjags. I use the standard install.packages("rjags"), which seems to be fine. But when I load the package, it does not work. This is what I get:

> library(rjags)
Loading required package: coda
Error : .onLoad failed in loadNamespace() for 'rjags', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.1/Resources/library/rjags/libs/rjags.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/rjags/libs/r jags.so, 10): Library not loaded: /usr/local/lib/libjags.3.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/3.1/Resources/library/rjags/libs/rjags.so
  Reason: image not found
In addition: Warning messages:
1: package ‘rjags’ was built under R version 3.1.3 
2: package ‘coda’ was built under R version 3.1.3 
Error: package or namespace load failed for ‘rjags’
> 

Any suggestions?

I use "R version 3.1.2 (2014-10-31)" "Pumpkin Helmet"

Upvotes: 1

Views: 3113

Answers (2)

Developer
Developer

Reputation: 976

I solved it by first removing the previously installed rjags package. The I installed the latest update of rjags by installing from https://sourceforge.net/projects/mcmc-jags/ and installed it as instructed by the readme file.

Then i just loaded it as usual in R.

Upvotes: 3

Jacob Socolar
Jacob Socolar

Reputation: 1202

I believe this the error means that you do not have a working copy of JAGS installed on your computer. Make sure to install a build of JAGS that is compatible with your operating system.

It is also possible that even if JAGS runs on your computer, it isn't compatible with the new version of rjags that you have installed. I know that JAGS version 4.x is not compatible with rjags version 3.x; perhaps the converse is also a problem.

To check what version of JAGS you have on your computer, just open the terminal and type jags.

Upvotes: 1

Related Questions