How to only install versions of packages that were made under a specific R release?

≡放荡痞女 提交于 2019-12-11 10:19:42

问题


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:


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.



来源:https://stackoverflow.com/questions/35890269/how-to-only-install-versions-of-packages-that-were-made-under-a-specific-r-relea

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!