简体   繁体   中英

R language package ltm issue with library command

I am hoping the someone can answer a short question on ltm.

ltm installs successfully with

 install.packages("ltm")

but the library command:

 library(ltm)

throws this error:

library(ltm) Error: package 'polycor' required by 'ltm' could not be found

I cannot locate polycor in the install.packages menu in RStudio.

This documentation on ltm: https://cran.r-project.org/web/packages/ltm/ltm.pdf does not mention polycor

I have used this package before without a problem, but it has been about one year since I last used it.

Thanks

You may need to update R. From CRAN polycor info it says the package depends on R>3.3.0. Additionally, this site may help.

If you are using linux, you should be able to type: R --version into a terminal to confirm which version you have

edit: though it appears my R version is 3.2.3...I may need to change my ubuntu repo

 sudo apt-cache showpkg r-base
 sudo apt-get upgrade r-base
 sudo apt-get install r-base

The previous contributor is right, you need to update your R version first and not through Rstudio. And then after you've done that proceed and install manually the polycor package via rstudio.

A) Update R

1) go to http://www.r-project.org , 2) click on 'CRAN', 3)then choose the CRAN site that you like. I used St Andrews, Scotland: http://star-www.st-andrews.ac.uk/cran/ click on 'Download R for XXX' [where XXX is your operating system] follow the installation procedure for your operating system resart RStudio

B) Install the polycor package using R studio:

I was interested in installing the ltm package but also needed polycor.

This is the code that did the trick for me - type it to the console:

install.packages("https://cran.r-project.org/bin/windows/contrib/3.4/polycor_0.7-9.zip", repos = NULL, type = "source")

Thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM