14

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 ?

PAC
  • 5,178
  • 8
  • 38
  • 62

1 Answers1

10

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).

Ellis Valentiner
  • 2,136
  • 3
  • 25
  • 36
  • 12
    How do you find the package version needed to install on a version of R? – highBandWidth Sep 28 '17 at 19:29
  • 1
    @highBandWidth, there is a label usually on CRAN, eg. 'Package source: ' and then below ' Old sources: ' which if you click it, gives you the list of the previous versions from the most recent. If the error messages don't direct you, some trial and error may be necessary. I do not know of a precise way to identify the A.B.C version correspondence for each package with the R version – Vass Jun 12 '21 at 00:31