繁体   English   中英

安装非CRAN package需要CRAN镜像

[英]Installation of non-CRAN package requires CRAN mirror

我正在尝试在基于 Linux 的计算集群上安装R-INLA 项目的 INLA INLA package 不在 CRAN 上。 根据他们的教程,使用就足够了

install.packages("INLA",repos=c(getOption("repos"),INLA="https://inla.r-inla-download.org/R/stable"), dep=TRUE)

用于安装,在我的本地机器上运行良好。 但是,在计算集群上,似乎需要 CRAN 镜像才能运行此命令,我收到以下错误:

Error in contrib.url(repos, type) : 
  trying to use CRAN without setting a mirror
Calls: install.packages -> startsWith -> contrib.url
Execution halted

作为替代方案,我尝试使用devtools直接从相应的 GitHub 存储库安装 package。 出于某种原因,这给了我明显不正确的版本号INLA_99.99.9999 这禁止我通过INLA:::inla.binary.install()手动添加必要的二进制文件,因为找不到版本号。 任何帮助表示赞赏!

您依赖于 (R global) options()在集群上具有有效的repos条目。

你...不能作为 base R 船(来源)没有 base R 核心感觉,对或错,他们不能播放收藏夹并设置一个。 我们中的一些人认为这是错误的(因为它削弱了用户体验——就像你在这里一样)所以在 Debian(以及因此的 Ubuntu)package 中,我将它设置为每个人都接近的“云”镜像,因为它在CDN上:

edd@rob:~$ tail -6 /usr/lib/R/etc/Rprofile.site 
## We set the cloud mirror, which is 'network-close' to everybody, as default
local({
    r <- getOption("repos")
    r["CRAN"] <- "https://cloud.r-project.org"
    options(repos = r)
})
edd@rob:~$ 

我建议你也这样做,也许在集群上的~/.Rprofile中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM