[英]Install specific package version in Microsoft R Open
How do I install a specific package version in Microsoft R Open (MRO)? 如何在Microsoft R Open(MRO)中安装特定的软件包版本? I am familiar with the
checkpoint("YYYY-MM-DD")
function for changing ALL package versions to a specific MRO snapshot. 我熟悉将所有软件包版本更改为特定MRO快照的
checkpoint("YYYY-MM-DD")
函数。 I do not want to do this. 我不想这样做。 I only want to change the version of a single package.
我只想更改单个软件包的版本。
To install a specific version of a package, download the package from the CRAN or MRAN archive (src/contrib/Archive) and install it with 要安装特定版本的软件包,请从CRAN或MRAN归档文件(src / contrib / Archive)下载该软件包,然后使用
install.packages("/path/to/pkg/src", type="source")
where/path/to/pkg/src is the path to the downloaded package. 其中/ path / to / pkg / src是下载软件包的路径。
To get the package directly from a specific MRAN snapshot, use 要直接从特定的MRAN快照获取软件包,请使用
install.packages('pkg', repos='https://mran.microsoft.com/snapshot/YYYY-MM-DD/')
To also get the dependencies, you want 要获得依赖关系,您需要
install.packages('pkg', repos='https://mran.microsoft.com/snapshot/YYYY-MM-DD/', dependencies=TRUE)
Be aware, however, that the version you choose may not be compatible with the version of MRO you are using. 但是请注意,您选择的版本可能与您使用的MRO版本不兼容。 This is why MRO uses a specific MRAN snapshot--to ensure compatibility of available packages with the specific MRO.
这就是MRO使用特定MRAN快照的原因-以确保可用软件包与特定MRO的兼容性。
I'm not too familiar with the checkpoint()
function but what I do see is that you can set project to a directory of packages you want to project be installed from the MRAN
snapshot for the date specified for snapshotDate
. 我对
checkpoint()
函数不太熟悉,但是我看到的是可以将project设置为要从MRAN
快照安装的要安装的目录目录,该目录的日期指定为snapshotDate
。 It defaults to current working directory using getwd()
, so I would assume if you changed the directory and had a specific package there, you would be able to workaround that way. 它默认使用
getwd()
设置为当前工作目录,因此我假设如果您更改了目录并在那里有特定的软件包,则可以通过这种方法解决。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.