Failing to install LTM in R - r

I'm a complete beginner with R and any kind of programming really, and struggling with installing the LTM package for use in making a rasch analysis in SPSS 26.
I've used the command
install.packages("ltm")
tried in R3.3, 3.5 and 3.6 (all in MS windows) as these are compatible with the versions of SPSS I have access to, and get the following output returned:
*Installing package into ‘C:/Users/info/OneDrive/Documents/R/win-library/3.5’ (as ‘lib’ is unspecified) also installing the dependencies ‘admisc’, ‘polycor’ There are binary versions available but the source versions are later:
binary source needs_compilation admisc 0.8 0.28 FALSE polycor 0.7-10 0.8-1 FALSE ltm 1.1-1 1.2-0 FALSE installing the source packages ‘admisc’, ‘polycor’, ‘ltm’ trying URL 'https://cran.ma.imperial.ac.uk/src/contrib/admisc_0.28.tar.gz' Content type 'application/x-gzip' length 58877 bytes (57 KB) downloaded 57 KB trying URL 'https://cran.ma.imperial.ac.uk/src/contrib/polycor_0.8-1.tar.gz' Content type 'application/x-gzip' length 13931 bytes (13 KB) downloaded 13 KB trying URL 'https://cran.ma.imperial.ac.uk/src/contrib/ltm_1.2-0.tar.gz' Content type 'application/x-gzip' length 287001 bytes (280 KB) downloaded 280 KB
* installing *source* package 'admisc' ...
** package 'admisc' successfully unpacked and MD5 sums checked
** libs
*** arch - i386 Warning in system(cmd) : 'make' not found ERROR: compilation failed for package 'admisc'
* removing 'C:/Users/info/OneDrive/Documents/R/win-library/3.5/admisc'
* restoring previous 'C:/Users/info/OneDrive/Documents/R/win-library/3.5/admisc' In R CMD INSTALL
* installing *source* package 'polycor' ...
** package 'polycor' successfully unpacked and MD5 sums checked
** R
** inst
** byte-compile and prepare package for lazy loading Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : namespace 'admisc' 0.8 is being loaded, but >= 0.22 is required ERROR: lazy loading failed for package 'polycor'
* removing 'C:/Users/info/OneDrive/Documents/R/win-library/3.5/polycor' In R CMD INSTALL ERROR: dependency 'polycor' is not available for package 'ltm'
* removing 'C:/Users/info/OneDrive/Documents/R/win-library/3.5/ltm' In R CMD INSTALL The downloaded source packages are in
‘C:\Users\info\AppData\Local\Temp\Rtmpc5HpAg\downloaded_packages’ Warning messages: 1: In install.packages("ltm") : installation of package ‘admisc’ had non-zero exit status 2: In install.packages("ltm") : installation of package ‘polycor’ had non-zero exit status 3: In install.packages("ltm") : installation of package ‘ltm’ had non-zero exit status*
I've also attempted to install earlier versions of admisc and polycor but get an error message that they are not available with this version of R.
Hope somebody can spot what I'm doing wrong here!
Thanks in advance

The error message 'make' not found suggests that you need to install Rtools to be able to build packages in Windows.
Since you are using an old R version you also need older Rtools version like Rtools35, found here.
When installing Rtools remember to add rtools to Path using the checkbox in the dialog similar to that one.

Related

Cannot load plm package after installing it?

Hello, could someone help me with this? I install the plm package, however, when I try to load it R gives me an error:
library(plm)
Output:
Error in library(plm) : there is no package called ‘plm’"
About the installation of the package that is the output:
install.packages("plm")
Output:
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/be_al/OneDrive - UvA/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
also installing the dependency ‘collapse’
There are binary versions available but the source versions are later:
binary source needs_compilation
collapse 1.5.3 1.7.6 TRUE
plm 2.4-1 2.6-1 FALSE
Binaries will be installed
tentando a URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/collapse_1.5.3.zip'
Content type 'application/zip' length 3842937 bytes (3.7 MB)
downloaded 3.7 MB
package ‘collapse’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\be_al\AppData\Local\Temp\Rtmp4gBL5q\downloaded_packages
installing the source package ‘plm’
tentando a URL 'https://cran.rstudio.com/src/contrib/plm_2.6-1.tar.gz'
Content type 'application/x-gzip' length 1652371 bytes (1.6 MB)
downloaded 1.6 MB
* installing *source* package 'plm' ...
** package 'plm' successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace 'collapse' 1.5.3 is being loaded, but >= 1.6.0 is required
Calls: <Anonymous> ... namespaceImportFrom -> asNamespace -> loadNamespace
Execução interrompida
ERROR: lazy loading failed for package 'plm'
* removing 'C:/Users/be_al/OneDrive - UvA/Documents/R/win-library/3.6/plm'
Warning in install.packages :
installation of package ‘plm’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\be_al\AppData\Local\Temp\Rtmp4gBL5q\downloaded_packages’
3. From previous posts here I tried:
install.packages("plm", dependencies = TRUE)
but it still didn't work for me. And I also tried installing and loading multiple times but always get the same error.
Try:
install.packages("plm",type="win.binary")
This must work

I am unable to install ggplot, there occurs some error

there is this long error message when i try to install ggplot, please someone help me. Thanks!
install.packages("ggplot2")
Installing package into ‘C:/Users/HP/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependency ‘rlang’
There are binary versions available but the source versions are later:
binary source needs_compilation
rlang 0.3.4 1.0.1 TRUE
ggplot2 3.1.1 3.3.5 FALSE
Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/rlang_0.3.4.zip'
Content type 'application/zip' length 1080437 bytes (1.0 MB)
downloaded 1.0 MB
package ‘rlang’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\HP\AppData\Local\Temp\Rtmpwfvrv8\downloaded_packages
installing the source package ‘ggplot2’
trying URL 'https://cran.rstudio.com/src/contrib/ggplot2_3.3.5.tar.gz'
Content type 'application/x-gzip' length 3063309 bytes (2.9 MB)
downloaded 2.9 MB
installing source package 'ggplot2' ...
** package 'ggplot2' successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace 'rlang' 0.3.4 is being loaded, but >= 0.4.10 is required
ERROR: lazy loading failed for package 'ggplot2'
removing 'C:/Users/HP/Documents/R/win-library/3.4/ggplot2'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-34~1.1/bin/i386/R" CMD INSTALL -l "C:\Users\HP\Documents\R\win-library\3.4" C:\Users\HP\AppData\Local\Temp\Rtmpwfvrv8/downloaded_packages/ggplot2_3.3.5.tar.gz' had status 1
Warning in install.packages :
installation of package ‘ggplot2’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\HP\AppData\Local\Temp\Rtmpwfvrv8\downloaded_packages’
It's saying your "rlang" version is outdated. Update that, it should be fine. Update all the libraries, that's a good practice while installing packages. (you do the same from tool option in menubar of Rstudio and update package)

How to compile an R package from source code in Windows 10

I need to compile an existing R package whose most recent version exists only as source code (it is on the CRAN website). I am running Windows 10. With Windows, install.packages just installs the older, binary version, which results in an error message and failure to install the package that depends on the one in question because the latter is not the recent version. I installed R Tools to my computer. The Installation and Administration manual for my version (3.6.3) refers to an Option “install.packages.compile.from.source.code”, but I don’t know to what command this option applies. If I run it in an Options() command it returns NULL. Moreover, the older, obsolete, binary version of the package was installed by install.packages. I don’t know if it is interfering with the process or how to get rid of it.
I can find guidance for ordinary install.packages and guidance for compilation oriented to package developers (which I’m not) in Stack Overflow, but nothing that applies to my situation (installing a package having an existing binary whose newest version exists only in source code, given that the binary version is already installed).
Any help you can offer would be greatly appreciated.
Thank you.
Sincerely,
Ward Kingkade
wwardkingkade#gmail.com
Illustration of basic issue (log):
> utils:::menuInstallPkgs()
--- Please select a CRAN mirror for use in this session ---
also installing the dependencies ‘ipred’, ‘recipes’
There are binary versions available but the source versions are later:
binary source needs_compilation
ipred 0.9-11 0.9-12 TRUE
recipes 0.1.16 0.1.17 FALSE
caret 6.0-86 6.0-90 TRUE
Binaries will be installed
trying URL 'https://mirrors.nics.utk.edu/cran/bin/windows/contrib/3.6/ipred_0.9-11.zip'
Content type 'application/zip' length 401183 bytes (391 KB)
downloaded 391 KB
trying URL 'https://mirrors.nics.utk.edu/cran/bin/windows/contrib/3.6/caret_6.0-86.zip'
Content type 'application/zip' length 6258933 bytes (6.0 MB)
downloaded 6.0 MB
package ‘ipred’ successfully unpacked and MD5 sums checked
package ‘caret’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Ward_\AppData\Local\Temp\RtmpghJ2SG\downloaded_packages
installing the source package ‘recipes’
trying URL 'https://mirrors.nics.utk.edu/cran/src/contrib/recipes_0.1.17.tar.gz'
Content type 'application/x-gzip' length 681531 bytes (665 KB)
downloaded 665 KB
* installing *source* package 'recipes' ...
** package 'recipes' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace 'ipred' 0.9-11 is being loaded, but >= 0.9.12 is required
Calls: <Anonymous> ... namespaceImportFrom -> asNamespace -> loadNamespace
Execution halted
ERROR: lazy loading failed for package 'recipes'
* removing 'C:/Users/Ward_/Documents/R/win-library/3.6/recipes'
The downloaded source packages are in
‘C:\Users\Ward_\AppData\Local\Temp\RtmpghJ2SG\downloaded_packages’
Warning message:
In install.packages(lib = .libPaths()[1L], dependencies = NA, type = type) :
installation of package ‘recipes’ had non-zero exit status

I can't seem to install the 'ecospat' package on R studio for windows

I am unable to install the 'ecospat' package on R and I was wondering why this could be?
After running the following bit of code using R in windows.....
install.packages('ecospat')
This is the error message I get...
Installing package into ‘C:/Users/etelford.IC.000/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependencies ‘pROC’, ‘biomod2’
There are binary versions available but the source versions are later:
binary source needs_compilation
pROC 1.14.0 1.16.2 TRUE
biomod2 3.3-7.1 3.4.6 FALSE
ecospat 3.0 3.1 FALSE
Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/pROC_1.14.0.zip'
Content type 'application/zip' length 941305 bytes (919 KB)
downloaded 919 KB
package ‘pROC’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\etelford.IC.000\AppData\Local\Temp\RtmpsBJC01\downloaded_packages
installing the source packages ‘biomod2’, ‘ecospat’
trying URL 'https://cran.rstudio.com/src/contrib/biomod2_3.4.6.tar.gz'
Content type 'application/x-gzip' length 665227 bytes (649 KB)
downloaded 649 KB
trying URL 'https://cran.rstudio.com/src/contrib/ecospat_3.1.tar.gz'
Content type 'application/x-gzip' length 2179055 bytes (2.1 MB)
downloaded 2.1 MB
installing source package 'biomod2' ...
** package 'biomod2' successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace 'pROC' 1.14.0 is being loaded, but >= 1.15.0 is required
ERROR: lazy loading failed for package 'biomod2'
removing 'C:/Users/etelford.IC.000/Documents/R/win-library/3.4/biomod2'
In R CMD INSTALL
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-34~1.4/bin/x64/R" CMD INSTALL -l "C:\Users\etelford.IC.000\Documents\R\win-library\3.4" C:\Users\ETELFO~1.000\AppData\Local\Temp\RtmpsBJC01/downloaded_packages/biomod2_3.4.6.tar.gz' had status 1
Warning in install.packages :
installation of package ‘biomod2’ had non-zero exit status
ERROR: dependency 'biomod2' is not available for package 'ecospat'
removing 'C:/Users/etelford.IC.000/Documents/R/win-library/3.4/ecospat'
In R CMD INSTALL
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-34~1.4/bin/x64/R" CMD INSTALL -l "C:\Users\etelford.IC.000\Documents\R\win-library\3.4" C:\Users\ETELFO~1.000\AppData\Local\Temp\RtmpsBJC01/downloaded_packages/ecospat_3.1.tar.gz' had status 1
Warning in install.packages :
installation of package ‘ecospat’ had non-zero exit status
Any help would be greatly appreciated,
thanks
First of all you need to update your R version. I think you use an R 3.4 version.
The main reason why your installation fails is that you need to install pROC > 1.15 and this is not available for R 3.4.

Different version of GlobalOptions package in R

I'm trying to install the package "circlize" and I am having trouble resolving what seems to be a simple error.
When I run:
install.packages("circlize")
It says:
Installing package into ‘*file location*/3.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
dependency ‘GlobalOptions’ is not available
There is a binary version available but the source version is later:
binary source needs_compilation
circlize 0.3.10 0.4.3 FALSE
installing the source package ‘circlize’
trying URL 'https://mirrors.sorengard.com/cran/src/contrib/circlize_0.4.3.tar.gz'
Content type 'application/x-gzip' length 2456906 bytes (2.3 MB)
downloaded 2.3 MB
* installing *source* package 'circlize' ...
** package 'circlize' successfully unpacked and MD5 sums checked
** R
** demo
** inst
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace 'GlobalOptions' 0.0.11 is being loaded, but >= 0.0.12 is required
ERROR: lazy loading failed for package 'circlize'
* removing '*file location*/3.2/circlize'
Warning in install.packages :
running command '"*file location*/x64/R" CMD INSTALL -l "*file location*\3.2" *file location*/downloaded_packages/circlize_0.4.3.tar.gz' had status 1
Warning in install.packages :
installation of package ‘circlize’ had non-zero exit status
The downloaded source packages are in
‘*file location*\downloaded_packages’
These parts seem most relevant to me:
dependency ‘GlobalOptions’ is not available
namespace 'GlobalOptions' 0.0.11 is being loaded, but >= 0.0.12 is required
When I run sessionInfo() I see under "other attached packages": [1] GlobalOptions_0.0.11
My best guess is that I have the wrong version of GlobalOptions -- I see that GlobalOptions v0.0.13 is available here, but being new to R, I'm not sure what to do now to get the right version up and running.
I'd really appreciate if someone could tell me where I should look next. (I looked through the documentation within that link, but I'm still lost about what to do now.) Thanks!
If you have R version >=3.3.0 you should
install GlobalOptions_0.0.13 from CRAN
install.packages("GlobalOptions")
quit and restart R
re-install circlize from source as before.
If you have an older R version, update R to a more recent version first.

Resources