如何仅安装在特定R版本下制作的软件包的版本? [英] How to only install versions of packages that were made under a specific R release?
问题描述
我使用基于R 3.2.2建立的Revolution R Enterprise发行版.因此,我对仅采用基于此R发行版的软件包版本感兴趣.在检查"checkpoint"或Revolution MRAN页面之类的程序包时,我仅找到了按日期访问CRAN快照的方法.有没有办法安装仍与某个R发行版兼容的最新软件包版本?
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?
推荐答案
我为自己的问题找到了一种启发性的解决方案:
I found a heuristical solution to my own problem:
- 了解稳定R版本的发布日期成功您的工作版本.
- 设置一个R脚本,通过单独的
library()
或require()
调用来调用项目所需的所有软件包. - 使用
checkpoint(release date minus at least one day)
自动创建与您的R版本兼容的项目特定库.
- Find out about the release date of the stable R version succeeding your working version.
- Set up an R script that calls all the packages you need for your project via individual
library()
orrequire()
calls. - 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.
第2步是一种确保所有必需软件包都被检测到的故障保护方法.我用sapply(package.list, require)
叫了它们,但checkpoint()
无法处理.针对此解决方案的一个可能警告是,它可能未提供仍与您的较旧R版本兼容的软件包的最新版本.另外,可以肯定的是,可以使用预发行日期代替稳定发行版来绝对确定兼容性.
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.
这篇关于如何仅安装在特定R版本下制作的软件包的版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!