Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Causes of "Error: package '_____' was built before 3.0.0: please re-install it" in R

Tags:

On one computer running R 2.15.2 I have installed packages from a .zip file (these packages happened to be ggplot2 and data.table, but I don't think the specific package is my issue.) Everything works fine. I took these packages to a computer without an internet connection and installed them. This other computer is running R 3.0.1. The packages seemed to install without a problem (using R's "install package(s) from local zip file" option). When I call the packages with the library(), I get the following error:

Error: package '<insert name of newly installed package here>' was build before 3.0.0: please-re-install it 

Can anyone explain potential causes for this error to be thrown? Are there particular directories that the .zip packages must be in for a proper install? If R is installed on a separate partition from where the .zip packages were loaded, could this cause the error?

I'm at a loss, any pointers are greatly appreciated. This is a difficult one to reproduce; if you need any other version/system parameters to understand the problem, please don't hesitate to ask.

like image 240
Docuemada Avatar asked Jun 07 '13 15:06

Docuemada


People also ask

Why I Cannot install package in R?

Changing the configuration in R Studio to solve install packages issue. Go To Tools -> Global option -> Packages. Then uncheck the option “Use secure download method for HTTP”. For other RStudio issues refer to official Troubleshooting Guide here.

What is the correct way to install the packages in R?

Open R via your preferred method (icon on desktop, Start Menu, dock, etc.) Click “Packages” in the top menu then click “Install package(s)”. Choose a mirror that is closest to your geographical location. Now you get to choose which packages you want to install.

How do I manually install a package in R?

Go into R, click on Packages (at the top of the R console), then click on "Install package(s) from local zip files", then find the zip file with arm from wherever you just saved it. Do the same thing to install each of the other packages you want to install.


2 Answers

I found this solution while look at GitHub ggplot2 issue #796

update.packages(checkBuilt = TRUE, ask = FALSE) 

It will update all the packages that need to be reinstalled.

like image 196
user3003714 Avatar answered Sep 20 '22 12:09

user3003714


Running install.packages("codetools") can fix this issue for R 3.0.2, if you have the same problem like me:

installing to /home/user/R/x86_64-pc-linux-gnu-library/3.0/Rcpp/libs ** R ** inst ** preparing package for lazy loading Error : package ‘**codetools**’ was built before R 3.0.0: please re-install it Error : unable to load R code in package ‘Rcpp’ ERROR: lazy loading failed for package ‘Rcpp’ 
like image 43
Richard Li Avatar answered Sep 18 '22 12:09

Richard Li