Using old packages that has not been updated on newer version of R - r

I have updated R and get problems when I want to run old scripts. Specifically, one of the packages I use has been removed from CRAN and I get the following error message when I try to load the installed package (installed from a binary file of the latest version of the package without any problem. As you can see, the package in question is the ACER package):
Failed with error: ‘package ‘acer’ was built before R 3.0.0: please re-install it’
Is it possible to recompile the source file to get binary files that work on R > 3.0.0?? This package worked fine on previous version R 3.0.1, but not on R 3.1.1. Is there any way I can get this package correctly loaded on R 3.1.1 (using either the source file or the file compiled for R 3.0.1?
I already tried to install from source, but it doesn't work. I get this error messages, which don't make too much sense to me. Is there an easy way out of this?
> install.packages(pkgs="acer_0.1.2.tar.gz", type="source", repos=NULL)
Installing package into ‘C:/Users/user/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
* installing *source* package 'acer' ...
** package 'acer' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
Warning: running command 'make -f "Makevars.win" -f "C:/PROGRA~1/R/R-31~1.1/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-31~1.1/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="acer.dll" OBJECTS="estimate_acer.o peaks.o"' had status 127
ERROR: compilation failed for package 'acer'
* removing 'C:/Users/user/Documents/R/win-library/3.1/acer'
* restoring previous 'C:/Users/user/Documents/R/win-library/3.1/acer'
Warning messages:
1: running command '"C:/PROGRA~1/R/R-31~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\user\Documents\R\win-library\3.1" "acer_0.1.2.tar.gz"' had status 1
2: In install.packages(pkgs = "acer_0.1.2.tar.gz", type = "source", :
installation of package ‘acer_0.1.2.tar.gz’ had non-zero exit status
I also tried installing it from the command line but get similar errors. Can anyone help?

Do you have Rcpp installed and on your path?
I think error code 127 on make means that the program couldn't be found in your $PATH and the only dependency of acer seems to be Rcpp.
Hope this helps
-A

Related

Error when trying to install vcfR in Rstudio

I'm having trouble installing the vcfR package in R studio.
I'm on Ubuntu 18.04.4 LTS in Rstudio and my R version 3.6.3
When I try to install using:
install.packages('vcfR')
I get a non-zero exit status
Installing package into ‘/home/username/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'http://cran.r-project.org/src/contrib/vcfR_1.11.0.tar.gz'
Content type 'application/x-gzip' length 1453180 bytes (1.4 MB)
==================================================
downloaded 1.4 MB
* installing *source* package ‘vcfR’ ...
** package ‘vcfR’ successfully unpacked and MD5 sums checked
** using staged installation
./configure: 4: ./configure: checkbashisms: not found
Warning in system(cmd) : error in running command
ERROR: configuration failed for package ‘vcfR’
* removing ‘/home/username/x86_64-pc-linux-gnu-library/3.6/vcfR’
Warning in install.packages :
installation of package ‘vcfR’ had non-zero exit status
I'm not really sure where to go from here or what to try to fix it.
This would appear to be due to a simple bug in the package vcfR. In the most recent version its configure script consists of
#!/bin/sh
#
checkbashisms --force
# EOF.
which makes little to no sense. CRAN never noticed because they now have the script checkbashishm (from Debian's devscript package) installed. Someone should tell the maintainer of vcfR to correct this. I'll send him a mail. At a minimum it should change to
if [ -f /usr/bin/checkbashisms ]; then
checkbashisms --force
fi
I found this on github, so apparently it is a general issue:
https://github.com/r-hub/rhub-linux-builders/issues/46
I'm also running Ubuntu 18.04.04, and got the same error message as you. I installed the devscripts package through the terminal using the following code:
sudo apt update
sudo apt install devscripts
I was then able to successfully install vcfR in RStudio.

how to install in R CvM2SL2Test package (Cramer-von Mises Two Sample Test)

I am trying to install the following package CvM2SL2Test in R, but i do not manage to do it. I have tried from CRAN, but it seems that it is not available anymore. In the end, i have tried locally (downloading the package from http://ftp.naist.jp/pub/CRAN/src/contrib/Archive/CvM2SL2Test/) but i am obtaining the following error:
Installing package into ‘C:/Users/David/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
* installing *source* package 'CvM2SL2Test' ...
** package 'CvM2SL2Test' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
Warning: comando ejecutado 'make -f "C:/PROGRA~1/R/R-34~1.4/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-34~1.4/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="CvM2SL2Test.dll" OBJECTS="CvM2SL2Test.o XCVM.o XCVMTailProb.o XCVMTailProb_EQ.o XCVMTailProb_NE1.o XCVMTailProb_NE2.o XCvMTest.o XFreqFunct.o"' tiene estatus 127
ERROR: compilation failed for package 'CvM2SL2Test'
* removing 'C:/Users/David/Documents/R/win-library/3.4/CvM2SL2Test'
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\David\Documents\R\win-library\3.4" "C:/Users/David/Downloads/CvM2SL2Test_2.0-1.tar.gz"' had status 1
Warning in install.packages :
installation of package ‘C:/Users/David/Downloads/CvM2SL2Test_2.0-1.tar.gz’ had non-zero exit status
Given that i am using windows 10, i have extracted the folder, and used the extention .zip. Then i have been able to obtain the following result:
Installing package into ‘C:/Users/David/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
package ‘CvM2SL2Test’ successfully unpacked and MD5 sums checked
However, when using like library(‘CvM2SL2Test’), I see the following:
library('CvM2SL2Test')
Error in library("CvM2SL2Test") :
‘CvM2SL2Test’ is not a valid installed package
I do not know how to install propery this package in windows 10 in order to use it properly, how can i do it?
Thanks in advance.
You appear to have a problem running the make command. This probably indicates that you don't have the R Tools collection (see https://cloud.r-project.org/bin/windows/Rtools/) installed, or it is not installed properly.

unable to reinstall mass package

I'm working with R Version 3.3.0 where the most installed packages have the versions 3.3.0, 3.3.2, 3.3.3.
Unfortunately, it seems that I have overwritten the MASS package with the actual version.
I needed the "vars" package and therefore a newer mass version was required. Now I'd like to reestablish the old mass package again.
Is there a solution to this problem? At present I do not want to update all the packages to actual versions as I'm not sure about the consequences...
Here is the Error Message when trying to install an older version...
Thank you!
Tobias
install.packages("O:/Shared_with_everyone/Rserver/MASS_7.3-45.tar.gz", repos = NULL, type="source")
* installing *source* package 'MASS' ...
** package 'MASS' successfully unpacked and MD5 sums checked
** libs
Warning: running command 'make -f "C:/Users/Public/R-33~1.0/etc/x64/Makeconf" -f "C:/Users/Public/R-33~1.0/share/make/winshlib.mk" SHLIB="MASS.dll" WIN=64 TCLBIN=64 OBJECTS="MASS.o lqs.o"' had status 127
ERROR: compilation failed for package 'MASS'
* removing 'C:/Users/Public/R-3.3.0/library/MASS'
* restoring previous 'C:/Users/Public/R-3.3.0/library/MASS'
Warning messages:
1: running command '"C:/Users/Public/R-3.3.0/bin/x64/R" CMD INSTALL -l "C:\Users\Public\R-3.3.0\library" "O:/Shared_with_everyone/Rserver/MASS_7.3-45.tar.gz"' had status 1
2: In install.packages("O:/Shared_with_everyone/Rserver/MASS_7.3-45.tar.gz", :
installation of package ‘O:/Shared_with_everyone/Rserver/MASS_7.3-45.tar.gz’ had non-zero exit status
under https://cran.r-project.org/bin/windows/contrib the relevant old versions can be found, which worked for Windows. Regards, Tobias

Installation of archived package "prob" not working in R

I'm running R 3.4.2 and R Studio 1.0.153. I want to install the prob package in R. The prob package in an archived file. It is located here. I am trying to install the prob_1.0-0.tar.gz package. I have no problem downloading and opening the package archive file. The code is below, it seems I need to install the fAsianOptions package.
ERROR: dependency 'fAsianOptions' is not available for package 'prob'
* removing 'C:/Users/blake_000/Documents/R/win-library/3.4/prob' Warning in install.packages : running command
'"C:/PROGRA~1/R/R-34~1.2/bin/x64/R" CMD INSTALL -l
"C:\Users\blake_000\Documents\R\win-library\3.4"
"C:/Users/BLAKE_~1/GOOGLE~1/Life/CSUEB/FALL20~1/6204-P~1/RCODE~1/prob_1.0-0.tar.gz"'
had status 1 Warning in install.packages : installation of package
‘C:/Users/BLAKE_~1/GOOGLE~1/Life/CSUEB/FALL20~1/6204-P~1/RCODE~1/prob_1.0-0.tar.gz’
had non-zero exit status
Unfortunately, the fAsianOptions package is also archived. It is located here and I downloaded version fAsianOptions_3010.79.tar.gz. There were a number of dependencies but I installed the required packages (timeDate, timeSeries, etc.)
However, the fAsianOptions package is not installing. The error code reads as follows:
install.packages("C:/Users/blake_000/Google Drive/Life/CSUEB/Fall
2017/6204- Probability/R Code/fAsianOptions_3010.79.tar.gz", repos =
NULL, type = "source") Installing package into
‘C:/Users/blake_000/Documents/R/win-library/3.4’ (as ‘lib’ is
unspecified)
* installing source package 'fAsianOptions' ...
** package 'fAsianOptions' successfully unpacked and MD5 sums checked
** libs
*** arch - i386 Warning: running command 'make -f "Makevars" -f "C:/PROGRA~1/R/R-34~1.2/etc/i386/Makeconf" -f
"C:/PROGRA~1/R/R-34~1.2/share/make/winshlib.mk"
SHLIB="fAsianOptions.dll" SHLIB_LIBADD='$(FLIBS)'
OBJECTS="EBMAsianOptions.o GammaFunctions.o
HypergeometricFunctions.o"' had status 127 ERROR: compilation failed
for package 'fAsianOptions'
* removing 'C:/Users/blake_000/Documents/R/win-library/3.4/fAsianOptions' Warning
in install.packages : running command
'"C:/PROGRA~1/R/R-34~1.2/bin/x64/R" CMD INSTALL -l
"C:\Users\blake_000\Documents\R\win-library\3.4"
"C:/Users/BLAKE_~1/GOOGLE~1/Life/CSUEB/FALL20~1/6204-P~1/RCODE~1/fAsianOptions_3010.79.tar.gz"'
had status 1 Warning in install.packages : installation of package
‘C:/Users/BLAKE_~1/GOOGLE~1/Life/CSUEB/FALL20~1/6204-P~1/RCODE~1/fAsianOptions_3010.79.tar.gz’
had non-zero exit status
I'm hoping that someone can help me to install the fAsianOptions dependency so I can install the prob package. Or, if there's an easier way, please let me know!
I had the same problem. I solved it by installing lower version of R -2.9. prob is available in repository for this version.

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

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.
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.
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’
I installed shiny according https://github.com/rstudio/shiny-server/wiki/Ubuntu-step-by-step-install-instructions
and got the same error at the step
sudo su - -c "R -e \"install.packages('shiny', repos='http://cran.rstudio.com/')\""
Warning messages:
1: In install.packages("shiny", repos = "http://cran.rstudio.com/") :
installation of package ‘Rcpp’ had non-zero exit status
2: In install.packages("shiny", repos = "http://cran.rstudio.com/") :
installation of package ‘httpuv’ had non-zero exit status
3: In install.packages("shiny", repos = "http://cran.rstudio.com/") :
installation of package ‘shiny’ had non-zero exit status
I tried the answer by Richard Lee by starting R
R
and got the error
Warning in install.packages("shiny") :
'lib = "/usr/local/lib/R/site-library"' is not writable
Would you like to use a personal library instead? (y/n) n
Error in install.packages("shiny") : unable to install packages
obviously no write permission, so
sudo R
Now I tried again
install.packages("shiny")
and got a number of errors
Error : package ‘codetools’ was built before R 3.0.0: please re-install it
Error : package ‘RJSONIO’ was built before R 3.0.0: please re-install it
Error : package ‘caTools’ was built before R 3.0.0: please re-install it
Error : package ‘bitops’ was built before R 3.0.0: please re-install it
Error : package ‘digest’ was built before R 3.0.0: please re-install it
Error : package ‘xtable’ was built before R 3.0.0: please re-install it
Each time I got an error, I re-installed the requested package
install.packages("codetools")
install.packages("RJSONIO")
etc.
and eventually, I was able to install Rccp, httpuv, and even shiny.
Now it works!!
Also see
Shiny package installation on R version 3.0.2 "Frisbee Sailing"
I am using rkward on precise
I had a similar error using rkward. Specifically this one:
'lib = "/usr/local/lib/R/site-library"' is not writable
I temporarily changed the permissions for this directory so that rkward could run this from its console:
update.packages(checkBuilt = TRUE, ask = FALSE)
all to fix this:
Error: package '' was build before 3.0.0: please-re-install it
so that (sigh...) I could fix 'default' configuration for audio on precise. I couldn't use play() etc. in rkward.
That just needed phonon-backend-gtstreamer
I tried to install swirl on R(v3.1.0) on ubuntu 12.04LTS:
sudo R
install.packages("swirl")
But faced a similar error:
Error : package ‘codetools’ was built before R 3.0.0: please re-install it
Error : unable to load R code in package ‘httr’
ERROR: lazy loading failed for package ‘httr’
* removing ‘/usr/local/lib/R/site-library/httr’
ERROR: dependencies ‘testthat’, ‘httr’ are not available for package ‘swirl’
* removing ‘/usr/local/lib/R/site-library/swirl’
Doing following helped me:
install.packages('codetools')
install.packages("swirl")
library("swirl")
swirl()
| Welcome to swirl! Please sign in. If you've been here before, use the same
| name as you did then. If you are new, call yourself something unique.
What shall I call you?
I hope the same may help fix your installation issue.
Here is the work-around that I used:
I installed the latest version of R on an internet-capable computer. I then loaded the my required packages (Packages->install packages->select mirror->select package...
After R is finished installing, it displays a message of where the temporary .zip package is located. I navigated to this location, grabbed the temp package, and burnt it to a cd.
In this way, I could get the newer package build onto a computer without internet access. I would still be interested to know if there is an easy way to rebuild a package downloaded on an early R version to make it compatible with the latest version (without needed an internet connection).
Thanks for pointing me in the right direction #JoshuaUlrich

Resources