Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What to do when a package is not available for our R version? [duplicate]

Tags:

r

Very often, when I try to download a package, I've got the following message :

Warning in install.packages :
  package ‘XXXX’ is not available (for R version 3.0.1)

Is it not possible to simulate an old version of R to use the package ?

like image 356
PAC Avatar asked Aug 01 '13 15:08

PAC


People also ask

How do I install an updated version of an R package?

To update everything without any user intervention, use the ask = FALSE argument. If you only want to update a single package, the best way to do it is using install. packages() again. In RStudio, you can also manage packages using Tools -> Install Packages.

What happens if you install a package twice in R?

It shouldn't be an issue unless you install a package as an admin user, and again as a normal user. Then you will have a version in two different locations on your system. That could lead to issues when upgrading, or confusion as to which version is loaded.

Why is my R not installing packages?

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.


1 Answers

Try something like:

packageurl <- "http://cran.r-project.org/src/contrib/Archive/XXXX/XXXX_A.B.C.tar.gz"
install.packages(packageurl, contriburl=NULL, type="source")

where XXXX is your package name and A.B.C is the version of the package (not R).

like image 92
Ellis Valentiner Avatar answered Sep 21 '22 20:09

Ellis Valentiner