How to only install versions of packages that were

2019-07-28 00:02发布

I use the Revolution R Enterprise distribution that is built upon R 3.2.2. Hence, I have an interest in only employing package versions that are based on this R release as well. Checking packages like 'checkpoint' or the Revolution MRAN page, I only found ways to access snapshots of CRAN datewise. Is there a way to install the most recent package versions still compatible with a certain R release?

1条回答
Evening l夕情丶
2楼-- · 2019-07-28 01:01

I found a heuristical solution to my own problem:

  1. Find out about the release date of the stable R version succeeding your working version.
  2. Set up an R script that calls all the packages you need for your project via individual library() or require() calls.
  3. Use checkpoint(release date minus at least one day) to automatically create a project specific library which is in harmony with your working R version.

Step 2 is a failsafe way to ensure detection of all necessary packages. I called them by sapply(package.list, require), which checkpoint() was not able to handle. A possible caveat against this solution might be that it possibly does not deliver the very last version of a package which is still compatible with your older R version. Alternatively, to be very sure, instead of the stable release one could use the prerelease date to be absolutely sure about compatibility.

查看更多
登录 后发表回答