1

I want to install a package that is not found in CRAN.

Below is a downloadlink to the package. The package makes use of JAGS, of which i have the 64 bit 4.3.0 version of. rjags and r2jags packages are installed. Rtools is connected to the pathway. I checked this using

Sys.which("make")
## "C:\\rtools40\\usr\\bin\\make.exe" 

Connection to path was done with devtools from this Stacklink:
How to add Rtools\bin to the system path in R

I use the following code to install the downloaded .tar.gz package:

install.packages("C:/Program Files/R/R-3.6.3/Liszt_0.8-5_1.tar.gz", repos=NULL,
                 type="source")

The package won't installl, instead i get the following error:

* installing *source* package 'Liszt' ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package 'Liszt'
    finding HTML links ... done
    A3ModelFun                              html  
    A5ModelFun                              html  
    Caterpillar                             html  
    LL                                      html  
    Liszt-package                           html  
    extract                                 html  
** building package indices
** testing if installed package can be loaded from temporary location
*** arch - i386
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

Error : package 'rjags' could not be loaded
Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'C:/Users/Sneve/Documents/R/win-library/3.6/Liszt'
Warning in install.packages :
  installation of package ‘C:/PROGRA~1/R/R-36~1.3/Liszt_0.8-5_1.tar.gz’ had non-zero exit status

I am trying for a while no, but no success. Any help is much appreciated.

Website providing the package:
http://www.possinghamlab.org/2016-05-30-04-33-10/list-length-analysis.html

package is available here:
http://www.possinghamlab.org/images/LLA/Liszt_0.8-5_1.tar.gz

Rui Barradas
  • 70,273
  • 8
  • 34
  • 66
Stevestingray
  • 399
  • 2
  • 12
  • 1
    Does rjags load okay -- can you run examples using it? – user20650 May 16 '20 at 15:36
  • I cannot run examples since i am not familiar with BUGS language. I do believe the package is loaded correctly. {Loading required package: coda Linked to JAGS 4.3.0 Loaded modules: basemod,bugs.} It does not give any errors when loading the package and also seems to specify the JAGS path correctly. – Stevestingray May 16 '20 at 15:48
  • given the onload messages it does seem that rjags should work. Try running the example rjags from [here](https://stackoverflow.com/questions/55843636/how-to-write-model-file-for-jags-binomial-using-logit-function/55849532#55849532) to test - ( only need to copy and paste code from answer and grab data from the question) – user20650 May 16 '20 at 15:58
  • ... but the package from the link has just a few R functions and doesnt require compilation i.e. you could just copy and paste them into your R session. So oyu could try that. (ps the package in your question installed fine for me) – user20650 May 16 '20 at 15:59
  • hmm is your pc 32 or 64 bit? The messages mention both `*** arch - i386` and `*** arch - x64` – user20650 May 16 '20 at 16:21
  • I used your rjags example to test if the package was working correctly; everything works fine. My computer runs on a 64 bit operating system. I will try to copy the functions from the package. Strange that it does install fine for you. – Stevestingray May 16 '20 at 16:43

1 Answers1

1

I installed the 64 Bit version of JAGS. Appearently, the package needs both the 32 and the 64 bit version installed on the PC to be able to work. After i installed also the 32 bit version of JAGS, package installed with no problem.

Stevestingray
  • 399
  • 2
  • 12
  • well done for finding an answer. It does seem weird -- ive never had this problem with rjags. It does remind me of struggles with rjava which ran fine on 64bit Windows but when I tried to install a custom package using rjava i got a lot of errors re 32 bit. I succeeded by reinstalling R but NOT installing 32 bit R when given the installer option. Now I always omit installing 32bit R when on windows. – user20650 May 19 '20 at 12:56