How to load rjags

squishy picture squishy · Oct 11, 2015 · Viewed 7.2k times · Source

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.

Answer

squishy picture squishy · Oct 11, 2015

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/