【发布时间】:2020-10-29 23:17:16
【问题描述】:
我正在尝试安装一些 R 包。不幸的是,这台机器无法访问互联网,所以我必须离线安装它们。
更具体地说,我正在尝试安装 stringi 软件包 (https://cran.r-project.org/web/packages/stringi/index.html)。
这些是我正在遵循的步骤:
-
从https://cran.r-project.org/src/contrib/stringi_1.5.3.tar.gz下载包(从有互联网连接的机器上)
-
在我有 R 的机器上创建一个文件夹作为仓库
-
运行这段代码:
library(tools) write_PACKAGES("./R_repo/") install.packages("stringi", contriburl="file:./R_repo")
安装实际上开始并通过了所有检查。问题是,作为该过程的一部分,它会在尝试下载其他文件时中断。
更具体地说:
trying URL 'https://raw.githubusercontent.com/gagolews/stringi/master/src/icu61/data/icudt61l.zip'
Error in download.file(paste(href, fname, sep = ""), icudtzipfname, mode = "wb"): cannot open URL
'https://raw.githubusercontent.com/gagolews/stringi/master/src/icu61/data/icudt61l.zip'
trying URL 'https://raw.githubusercontent.com/gagolews/stringi/master/src/icu55/data/icudt61l.zip'
Error in download.file(paste(href, fname, sep = ""), icudtzipfname, mode = "wb"): cannot open URL
'https://raw.githubusercontent.com/gagolews/stringi/master/src/icu55/data/icudt61l.zip'
trying URL 'http://raw.githubusercontent.com/gagolews/stringi/master/src/icu61/data/icudt61l.zip'
Error in download.file(paste(href, fname, sep = ""), icudtzipfname, mode = "wb"): cannot open URL
'http://raw.githubusercontent.com/gagolews/stringi/master/src/icu61/data/icudt61l.zip'
trying URL 'http://raw.githubusercontent.com/gagolews/stringi/master/src/icu55/data/icudt61l.zip'
Error in download.file(paste(href, fname, sep = ""), icudtzipfname, mode = "wb"): cannot open URL
'http://raw.githubusercontent.com/gagolews/stringi/master/src/icu55/data/icudt61l.zip'
trying URL 'http://www.ibspan.waw.pl/~gagolews/stringi/icudt61l.zip'
Error in download.file(paste(href, fname, sep = ""), icudtzipfname, mode = "wb"): cannot open URL
'http://www.ibspan.waw.pl/~gagolews/stringi/icudt61l.zip'
trying URL 'http://www.gagolewski.com/software/stringi/icudt61l.zip'
Error in download.file(paste(href, fname, sep = ""), icudtzipfname, mode = "wb"): cannot open URL
'http://www.gagolewski.com/software/stringi/icudt61l.zip'
icudt download failed
Error: Stopping on error
有没有办法手动下载这些附加文件并将它们保存在机器上,这样在安装过程中就不必从互联网上获取它们?
谢谢你, 马可
【问题讨论】:
标签: r installation package offline