简体   繁体   中英

Error in in installing an old version of a R package

I tryed to install from file an old version of RgoogleMaps package with this command

install.packages("F://RgoogleMaps_1.1.9.15.tar.gz", repos = NULL, type="source")

but i found this error message:

* installing *source* package 'RgoogleMaps' ...
** package 'RgoogleMaps' successfully unpacked and MD5 sums checked
ERROR: a 'NAMESPACE' file is required
* removing 'C:/Users/Famiglia Mazza/Documents/R/win-library/3.1/RgoogleMaps'
* restoring previous 'C:/Users/Famiglia Mazza/Documents/R/win-library/3.1/RgoogleMaps'
Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-31~1.2/bin/x64/R" CMD INSTALL -l "C:\Users\Famiglia Mazza\Documents\R\win-library\3.1" "F://RgoogleMaps_1.1.9.15.tar.gz"' had status 1
Warning in install.packages :
  installation of package ‘F://RgoogleMaps_1.1.9.15.tar.gz’ had non-zero exit status

what can I do? I'm using R on Windows

In R 2.14.0 a requirement was made that all packages had namespaces, but as a transitional arrangement those that didn't would have one automatically generated at install time.

A package R code but without a 'NAMESPACE' file will have a default one created at R CMD build or R CMD INSTALL time, so all packages will be installed with namespaces. A consequence of this is that .First.lib() functions need to be copied to .onLoad() (usually) or .onAttach(). For the time being, if there is an auto-generated 'NAMESPACE' file and no .onLoad() nor .onAttach() function is found but .First.lib() is, it will be run as the attach hook (unless the package is one of a list of known exceptions, when it will be run as the load hook).

However, by R 3.0.0 this transitional arrangement was ended:

The transitional support for installing packages without namespaces (required since R 2.14.0) has been removed. R CMD build will still add a namespace, but a .First.lib() function will need to be converted.

R CMD INSTALL no longer adds a namespace (so installation will fail), and a .First.lib() function in a package will be ignored (with an installation warning for now).

As an exception, packages without a 'R' directory and no 'NAMESPACE' file can still be installed.

Therefore, I suggest you use an older version of R to run this package. One prior to R 3.0.0 should suffice, and the latest one prior to that is R 2.15.3 .

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