Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to define the version of a package in R install.packages?

Tags:

r

I know that you can download old packages and install them with

R CMD INSTALL package-version.tar.gz

I wonder if you can tell install.packages() to install a specific version from a repository, saving you from having to locate the tar.gz first. I have neither found this option in the help entry for install.packages nor googling for it. If this option does not exist, is there any reason for that?. I can only think that not all repos have all versions so you are forced to find the version first and download it.

There is an equivalent question already in SO but the problem and answer is more about repository problems, so at the end they never answered this question directly.

like image 240
Pablo Marin-Garcia Avatar asked Oct 01 '12 08:10

Pablo Marin-Garcia


1 Answers

install.packages() does not, but there is a function install_version() in the devtools package which can install a version other than the most recent one from a CRAN repository.

like image 60
Brian Diggs Avatar answered Nov 15 '22 20:11

Brian Diggs