S.O.: Linux Ubuntu 14.04 LTS R: R version 3.2.1 (2015-06-18) -- "World-Famous Astronaut" Copyright (C) 2015 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-bit)
When I try to install the package rjags
, I get the following fatal error:
install.packages("rjags")
Installing package into ‘/home/marco/.rkward/library’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
trying URL 'http://mirrors.softliste.de/cran/src/contrib/rjags_3-15.tar.gz'
Content type 'application/x-gzip' length 66879 bytes (65 KB)
==================================================
downloaded 65 KB
* installing *source* package ‘rjags’ ...
** package ‘rjags’ successfully unpacked and MD5 sums checked
checking for prefix by checking for jags... no
configure: error: "Location of JAGS headers not defined. Use configure arg '--with-jags-include' or environment variable 'JAGS_INCLUDE'"
ERROR: configuration failed for package ‘rjags’
* removing ‘/home/marco/.rkward/library/rjags’
The downloaded source packages are in
‘/tmp/RtmpditLat/downloaded_packages’
Warning message:
In install.packages("rjags") :
installation of package ‘rjags’ had non-zero exit status
Apparently, the first error message is
configure: error: "Location of JAGS headers not defined. Use configure arg '--with-jags-include' or environment variable 'JAGS_INCLUDE'"
How can I solve this?
As a top comment explained, you need JAGS (Just Another Gibbs Sampler) to be installed in your system. Since you're using Ubuntu 14.04, running
sudo apt-get install jags
should be enough. However, in case you're in another distribution (or, for some reason, the code above doesn't work for you), it's a good idea to know how to get JAGS from the source:
After the installation is successful, you can go back to R (which can stay open during the whole thing, anyway) and install the package you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With