Unable to load rjags in R.3.0.2.
Brought to you by:
martyn_plummer
Hello,
I'm trying to install rjags on Win7, R version 3.0.2.
JAGS version is 3.4.0.
In my computer, rjags is working fine with R version 2.15.1 (rjags_3-13, coda_0.16-1)
With v.3.0.2, I receive: (coda_0.17-1)
library(rjags)
Error : .onLoad failed in loadNamespace() for 'rjags', details:
call: packageVersion(pkg, lib)
error: package ‘rjags’ not found
In addition: Warning message:
package ‘rjags’ was built under R version 3.0.3
Error: package or namespace load failed for ‘rjags’
I went through the messages here, but I cannot locate any possible reason.
Any help would be appreciated.
Ath.Tsakonas
Anonymous
You are not using the latest version of R (3.2.0) and so do not have access to the latest version of rjags (3-15). Try upgrading.
Thank you for your prompt reply.
I understand that the latest version should ensure a better compatibility. As long as this concerns myself, I'm running R on a controlled environment (e.g. not as an admin) and therefore I am not able to update the R version on-the-fly (needs ticket to IT, and time for evaluation, and re-installation of libraries, then further evaluation on existing running code, etc.). In other words, it can merely be a distant option.
On the other hand, I read on CRAN rjags specifications, that rjags 3-15 requires:
If this compatibility issue is unresolved otherwise, shouldn't that requirement reference be changed to R (≥ 3.0.2), to prevent future misunderstandings with the rest CRAN users?
Many thanks again,
Ath.Tsakonas
Sorry, my mistake. I thought rjags_3-15 would not be available for R 3.0.2 but checking the CRAN web site I see that it is.
It looks like you have a broken installation of rjags. Try typing
packageDescription("rjags")
at the prompt and see what happens.
Hello,
Rjags won't load. The following is the returned output.
NOT SHOWN IN sessionInfo() as well
ROOT DIR FOR JAGS IS SET
PATHS INCLUDED
RJAGS IS INSTALLED
JAGS IS INSTALLED
Ath.Tsakonas
This turns out to be a bug in R itself. The
packageDescription()
function does not work when your library is on a network drive (driveJ
in your case). I have confirmed this on my own network.I shall push a new version of rjags with a workaround, but will also fix the bug in R.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bug reports"
Hi!
I get a similar message with newest version of R and JAGS installed:
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’
Do you have any solution ideas for this problem?
When you say the newest version of JAGS, do you mean version 4.0.0? Because you then need the corresponding version of the rjags package, i.e. rjags_4-3. It is not yet available from CRAN but you can download it here:
http://sourceforge.net/projects/mcmc-jags/files/rjags/4/rjags_4-3.zip/download
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bug reports"
It helped. Thanks friend, you are great. Earlier i wasted hours to find a solution on the google...
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bug reports"
Hello,
I use R 3.4.0 and Installed rjags_4-6 on my Windows 7 pc, and jags doesn’t seem to work. The error message I get is:
Error: package or namespace load failed for ‘rjags’:
.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
Would you help me please?
Did you do the thing that the error message asks you to do?
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bug reports"
I see! It worked. Sorry, my mistake. Thank you very much.
Hello
I am having trouble to load the rjags package on R 3.4.3. The package had downlaoded properly as i can see it on the right side of the RStudio but I am unable to load it
Error: package or namespace load failed for ‘rjags’:
.onLoad failed in loadNamespace() for 'rjags', details:
call: packageVersion(pkg, lib)
error: package ‘rjags’ not found
I tried to uninstall R and JAGS multiple times and dowload different versions of JAGS (3 and 4) but none seem to change anything.
I tried
devtools::install_url("http://sourceforge.net/projects/mcmc-jags/files/rjags/4/rjags_4-4.tar.gz",
args="--configure-args='--with-jags-include=/Users/casallas/homebrew/opt/jags/include/JAGS
--with-jags-lib=/Users/casallas/homebrew/opt/jags/lib'")
But I get :
Installation failed: Command failed (1)
I have also tried installing from the rjags source file:
install.packages('~/Downloads/rjags_4-6.tar.gz', repos = NULL, type="source")
But still get the same error message.
Any ideas?
Thanks
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bug reports"
Hi I have exactly the same problem that you Laura, idem R version 3.4.3
Hi
I am having the same problem as Anonymous from 06/05/2015 with this same bug.
R version 3.5.1 JAGS 4.6.0 RStudio 1.1.456
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/coda_0.19-1.zip'
Content type 'application/zip' length 320312 bytes (312 KB)
downloaded 312 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/rjags_4-6.zip'
Content type 'application/zip' length 620629 bytes (606 KB)
downloaded 606 KB
package ‘coda’ successfully unpacked and MD5 sums checked
package ‘rjags’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\18719303\AppData\Local\Temp\RtmpMt90l6\downloaded_packages
Matrix products: default
locale:
[1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252 LC_MONETARY=English_Australia.1252
[4] LC_NUMERIC=C LC_TIME=English_Australia.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] coda_0.19-1
loaded via a namespace (and not attached):
[1] compiler_3.5.1 tools_3.5.1 grid_3.5.1 lattice_0.20-35
May I have any advice on how to proceed from here?
I wish to use JAGS in R.
Thanks!
Evelyn
This looks like a configuration problem with your R library. Can you load the coda package?
If this does not work, then try
to see where R is looking for your packages. According to the output, the packages are installed in an SMB-mounted drive:
\\uniwa.uwa.edu.au/userhome/students3/18719303/My Documents/R/win-library/3.5
However, I don't think the double backslash SMB notation is going to work when R looks for your library (Backslash causes a lot of problems in strings in R). If the drive is mounted with a drive letter then use that, and make sure you have only forward slashes in the file path, e.g.
Z:/My Documents/R/winlibrary/3.5
Let me know if this works.
Martyn
Hi Martyn,
Thank you for your reply.
I can load the coda package.
I found where the rjags package was loaded to and it was in the H drive.
This is what I tried and got the same error message:
I then tried:
This showed that neither rjags nor coda were in the System Library.
Does this shed any light on this problem?
Thanks!
Evelyn
Last edit: Martyn Plummer 2018-09-07
This is still very mystifying. Try
and
This is the point in the code that loads the rjags package where the error occurs.
Hi Martyn
A colleague found the problem.
Rstudio was loaded on to the university server which wasn’t allowing packages being installed as I don’t have the admin rights.
When we loaded Rstudio on to a local disk, rjags loaded fine.
It wasn’t a bug after all.
Thank you for your help!
Evelyn
Last edit: Martyn Plummer 2018-09-10
Hi, if this chain is still active! I'm trying to load Rjags and getting the following error message in RStudio upon calling
library(rjags)
:I've checked my library and the file '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rjags/libs/rjags.so'
is indeed there -- so I don't think the library reference is the problem.
When I open the file '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rjags/Meta/package.rds ' ,
I get the error message:
I have downloaded the most recent version of JAGS at the link: https://sourceforge.net/projects/mcmc-jags/ (using the website)
Any suggestions for how to solve this?
Thank you,
Abigail
Hello Martin
I started to have the same problem after I updated Rstudio (i had to, graphics were not working anymore).
I'm running a Win10 machine with R 4.1.1 and JAGS 4.3.0.
I got the following error message:
and the packageDescription("rjags") gives the following message:
Can you offer any help?
Hello, I m getting the same issue, that i have R 4.1.1 and JAGS 4.2.0 but getting similar so how did you solve it
Had to go back to a previous version (4.0.2)
Just an update.
It seems the problem is with the R version. I'm able to work with an older version of R (4.0.2)
Last edit: Mário Mota-Ferreira 2021-10-08
The problem was a bug introduced in rjags_4-11. I have fixed it in rjags_4-12, which has just been uploaded to CRAN.
I made some changes for the new R toolchain, which is 64-bit only, but accidentally broke the code that reads the Windows registry to find JAGS. This bug was not detected by CRAN because they use a hard-coded path to JAGS.
Thanks Martyn!
Do we need to update R or just rjags?
Cheers