【问题标题】:R offline package installationR离线包安装
【发布时间】:2020-10-29 23:17:16
【问题描述】:

我正在尝试安装一些 R 包。不幸的是,这台机器无法访问互联网,所以我必须离线安装它们。
更具体地说,我正在尝试安装 stringi 软件包 (https://cran.r-project.org/web/packages/stringi/index.html)。 这些是我正在遵循的步骤:

  1. 从https://cran.r-project.org/src/contrib/stringi_1.5.3.tar.gz下载包(从有互联网连接的机器上)

  2. 在我有 R 的机器上创建一个文件夹作为仓库

  3. 运行这段代码:

    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


    【解决方案1】:

    你没有 Rstudio 吗?在顶部工具栏下,有一个 tools 选项卡,如果单击该下拉菜单,您应该会看到一个 install packages... 选项,您可以在此处浏览文件并找到已下载并移动到的 .zip 文件从 USB 闪存驱动器访问 PC。如果您没有 Rstudio,不妨也下载带有所需软件包的 .EXE,值得您花时间。

    【讨论】:

    • 您好,我没有 rstudio,我所说的机器是一个远程 UNIX 服务器,我可以在其中通过 ssh 进入它
    • 是 AIX 吗?您将需要与文件所在目录不同的语法install.packages(list.files(pattern="*.tar.gz"), repos=NULL)。您需要执行getwd() 并转到包文件所在的位置。
    • 它是红帽。所以基本上我应该下载额外的文件并将它们放在本地 repo 中?
    • install.packages("stringr") 命令将触发该命令访问互联网。
    • 我认为.tar.gz 应该已经拥有你需要的一切,不是吗?
    猜你喜欢
    • 2013-06-15
    • 1970-01-01
    • 2012-06-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-17
    • 2012-06-20
    相关资源
    最近更新 更多