install specific package version

354 views
Skip to first unread message

Moritz Beber

unread,
Mar 17, 2015, 5:39:53 PM3/17/15
to packrat...@googlegroups.com
Hi,

With regard to my other post (https://groups.google.com/forum/#!topic/packrat-discuss/CCllnwAp6ZE) I decided to write my own scripts.

I'm currently tackling the problem of installing specific versions of scripts. I found a decent gist that does this (https://gist.github.com/viking/1503736) but packrat must already have a solution to this problem as well since you can bootstrap a project from a packrat.lock file without the sources directory. So is there a function within packrat that I can use for this purpose?

Thanks in advance,
Moritz

Stéphane Laurent

unread,
Dec 6, 2016, 9:56:48 AM12/6/16
to packrat-discuss
Same question... how to install for example an older version of ggplot2 ?

Stéphane Laurent

unread,
Dec 6, 2016, 10:06:56 AM12/6/16
to packrat-discuss
Useful info here, but not related to packrat: https://support.rstudio.com/hc/en-us/articles/219949047-Installing-older-versions-of-packages 

devtools::install_version(...) works fine, but this requires to add devtools to my packrat project ?

Installing from source should work, but this does not install the dependencies.


Stéphane Laurent

unread,
Dec 6, 2016, 1:18:16 PM12/6/16
to packrat-discuss
devtools::install_version(...) works fine, but this requires to add devtools to my packrat project ?

Hmm I see. One can install devtools in the library lib-r, then use devtools::install_version.

Kevin Ushey

unread,
Dec 7, 2016, 2:24:53 PM12/7/16
to Stéphane Laurent, packrat-discuss
Unfortunately, the packrat code that handles this is not yet exposed, but you can see what packrat does here (the code is unfortunately not nearly as clear as it could be):


The general idea, though, is given a package name + version, you want to:

1. First check if the package is 'current'; this can usually be checked by comparing the relevant values in the output of `available.packages()`,
2. If that doesn't work, try constructing an appropriate URL to the CRAN archives, and downloading from that location.

Also note complications re: downloading package binaries vs. package sources; you might need to ensure that the 'pkgType' option is set to 'source' if you want sources (e.g. for the 'available.packages()' output).

Kevin



On Tue, Dec 6, 2016 at 10:18 AM, 'Stéphane Laurent' via packrat-discuss <packrat...@googlegroups.com> wrote:
devtools::install_version(...) works fine, but this requires to add devtools to my packrat project ?

Hmm I see. One can install devtools in the library lib-r, then use devtools::install_version.

--
You received this message because you are subscribed to the Google Groups "packrat-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packrat-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ronald Reck

unread,
Apr 1, 2017, 4:35:02 PM4/1/17
to packrat-discuss
I too am interested in determining exactly the packages and versions I have installed and recreating (here and elsewhere) them non-interactively. I am new to packrat and will have test to see if I can do what I am thinking about.
Reply all
Reply to author
Forward
0 new messages