[R] rjags cannot find JAGS-4.0.0

David Winsemius dwinsemius at comcast.net
Fri Nov 27 20:27:29 CET 2015


> On Nov 26, 2015, at 4:59 PM, Margaret Donald <merricks.merricks at gmail.com> wrote:
> 
> 1. Despite being in R with administrative rights  the library "rjags" loads
> in a temporary location.
> 
>> install.packages("rjags", dependencies=TRUE,
> +       lib= "C:/Users/Margaret Donald/Documents/R/win-library/3.2")
> trying URL 'https://cran.r-project.org/bin/windows/contrib/3.2/rjags_4-4.zip
> '
> Content type 'application/zip' length 525871 bytes (513 KB)
> downloaded 513 KB
> 
> package ‘rjags’ successfully unpacked and MD5 sums checked
> 
> The downloaded binary packages are in
>        C:\Users\Margaret
> Donald\AppData\Local\Temp\RtmpMzv76s\downloaded_packages

That’s not an indication of an error. The installation process always does that.


> #-----------------------------------------------------------------------------------------------------------------
> 
> 2. Cannot find JAGS-4.0.0 which is in C;\programs\JAGS\JAGS-4.0.0.  How do
> I get R to see JAGS-4.0.0

You might try to use Sys.setenv to create a properly directed JAGS_HOME

Sys.setenv(JAGS_HOME=“C:\programs\JAGS\JAGS-4.0.0”)

(I corrected the semi-colon.) 
>> library(rjags)
> Error : .onLoad failed in loadNamespace() for 'rjags', details:
>  call: fun(libname, pkgname)
>  error: Failed to locate any version of JAGS version 4
> 
> The rjags package is just an interface to the JAGS library
> Make sure you have installed JAGS-4.x.y.exe (for any x >=0, y>=0) from
> http://www.sourceforge.net/projects/mcmc-jags/files

I’m was having a perhaps similar problem on a Mac. The binary version 3-15 of rjags installed today from CRAN was trying to access /usr/local/lib/libjags.3.dylib, but since I have installed JAGS version 4.0.1 installed from the SourceForge repository, there is no ligjags.3.dylib, but instead there was only a /usr/local/lib/libjags.4.dylib


Going back to SourceForge and tracking down the older version of JAGS and installing version 3.4.0 was successful in getting rjags to load correctly. I suspect that with the release of JAGS v4 that there is some mismatch among the various editions of rjags and JAGS.

— 
David
> 
> Error: package or namespace load failed for ‘rjags’
>> library(R2jags)
> Loading required package: rjags
> Error : .onLoad failed in loadNamespace() for 'rjags', details:
>  call: fun(libname, pkgname)
>  error: Failed to locate any version of JAGS version 4
> 
> The rjags package is just an interface to the JAGS library
> Make sure you have installed JAGS-4.x.y.exe (for any x >=0, y>=0) from
> http://www.sourceforge.net/projects/mcmc-jags/files
> 
> Error: package ‘rjags’ could not be loaded
>> 
> 
> Regards,
> Margaret Donald
> -- 
> Margaret Donald
> Post Doctoral researcher
> University of New South Wales
> margaret.donald at unsw.edu.au
> 0405 834 550
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA



More information about the R-help mailing list