pak icon indicating copy to clipboard operation
pak copied to clipboard

Helper for migrating pkgs across R versions

Open jimhester opened this issue 6 years ago • 2 comments

This has been a question a number of different times, some I can recall are @jennybc's workshop at RStudio::conf, @OmaymaS on twitter (https://twitter.com/OmaymaS_/status/1004468608028807170) and elsewhere.

The general consensus is that typically people take the time to re-build their library from scratch, but this is somewhat painful in practice.

Copying packages directly across R versions is problematic, and enumerating across all R packages in the old library is both tricky (due to GH packages + recommended packages) and often overkill.

One potentially useful way to do this would be to copy only packages which had an OS access time less than a cutoff (maybe 30 days by default), which would let you copy all packages that have been recently in use. We could use the RemoteSHA information in the DESCRIPTION to retrieve GH packages as needed.

This would let you fairly easily re-build the useful set of packages from an old library with one call, and take away a lot of the pain when upgrading to a new R version.

jimhester avatar Jun 18 '18 20:06 jimhester

I think also interesting to at least record current state, i.e. what you have in which library and each package's version (or, if installed from GitHub, SHA). Even if you don't attempt to restore it all. I have a hacky script where I write this sort of csv for myself before upgrading R and rebuilding my library.

jennybc avatar Jun 18 '18 21:06 jennybc

I think we should just rebuild the library from scratch. This can be done once every three months overnight, even for larger libraries.

krlmlr avatar Jan 19 '19 20:01 krlmlr