How to install the library (readr)?

I am surprised that library(readr)it cannot be suddenly loaded:

library(readr)
Error in loadNamespace(j <- imp[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  there is no package called ‘Rcpp’
In addition: Warning message:
package ‘readr’ was built under R version 3.2.2 
Error: package or namespace load failed for ‘readr’

So I tried:

install.packages("Rcpp") #with all dependencies
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/Rcpp_0.12.1.zip'
Content type 'application/zip' length 3189720 bytes (3.0 MB)
downloaded 3.0 MB

package ‘Rcpp’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘Rcpp’

The downloaded binary packages are in
C:\Users\m\AppData\Local\Temp\RtmpMd0LfX\downloaded_packages

After that I tried as recommended in SO:

install.packages("readr", repos=c("http://rstudio.org/_packages",   "http://cran.rstudio.com"))

also installing the dependency ‘Rcpp’

Warning in install.packages :
  cannot open: HTTP status was '404 Not Found'
Warning in install.packages :
  cannot open: HTTP status was '404 Not Found'
Warning in install.packages :
  unable to access index for repository     http://rstudio.org/_packages/bin/windows/contrib/3.2
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/Rcpp_0.12.1.zip'
Content type 'application/zip' length 3189720 bytes (3.0 MB)
downloaded 3.0 MB

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/readr_0.1.1.zip'
Content type 'application/zip' length 1128358 bytes (1.1 MB)
downloaded 1.1 MB

package ‘Rcpp’ successfully unpacked and MD5 sums checked
Warning in install.packages :
 cannot remove prior installation of package ‘Rcpp’
package ‘readr’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\m\AppData\Local\Temp\RtmpMd0LfX\downloaded_packages

Did I miss something?

+4
source share
1 answer

You are on Windows and it has a slight problem trying to update packages that include compiled code (like readr and Rcpp). Basically, if these packages are downloaded, you cannot update them; and there’s no way to unload them. Therefore, you need to restart R in "vanilla" mode (ie, Download only the base packages). At the command prompt, do the following:

R --vanilla

Then you can install these packages. I would try:

install.packages(c("Rcpp", "readr"))

and you should be good to go.

+10

Source: https://habr.com/ru/post/1610154/


All Articles