user3833190
user3833190

Reputation:

How to install the library(readr)?

I'm suprised that library(readr) can't suddenly be 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 on 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

Do I miss something?

Upvotes: 6

Views: 23850

Answers (1)

Thomas
Thomas

Reputation: 44525

You're on Windows and it has a little problem with trying to update packages that involve compiled code (such as readr and Rcpp). Basically, if those packages are loaded, you cannot update them; and there's no way to unload them. So you need to restart R in "vanilla" mode (i.e., with nothing but the base packages loaded). From your command prompt do:

R --vanilla

Then, you should be able to install those packages. I would try:

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

and you should be good to go.

Upvotes: 15

Related Questions