【问题标题】:error install packages in r ‘lib’ is unspecified未指定 r ‘lib’ 中的错误安装包
【发布时间】:2020-07-29 15:55:48
【问题描述】:

我在 R 中安装软件包时遇到问题。

install.packages('rlang')
Installing package into ‘C:/Users/durandeb/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)

  There is a binary version available but the source version is later:
      binary source needs_compilation
rlang  0.3.4  0.4.7              TRUE

  Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/rlang_0.3.4.zip'
Content type 'application/zip' length 1080437 bytes (1.0 MB)
downloaded 1.0 MB

package ‘rlang’ successfully unpacked and MD5 sums checked
Warning in install.packages :
  unable to move temporary installation ‘C:\Users\durandeb\Documents\R\win-library\3.4\file33204d29164f\rlang’ to ‘C:\Users\durandeb\Documents\R\win-library\3.4\rlang’

The downloaded binary packages are in
    C:\Users\durandeb\AppData\Local\Temp\4\RtmpETJiDu\downloaded_packages

包最终保存在一个临时库中

如何分配默认库?它不允许我安装在任何路线上。

> .libPaths()
[1] "C:/Users/durandeb/Documents/R/win-library/3.4" "C:/Program Files/R/R-3.4.2/library"     

install.packages('rlang',lib = "C:/Users/durandeb/Documents/R/win-library/3.4")

  There is a binary version available but the source version is later:
      binary source needs_compilation
rlang  0.3.4  0.4.7              TRUE

  Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/rlang_0.3.4.zip'
Content type 'application/zip' length 1080437 bytes (1.0 MB)
downloaded 1.0 MB

package ‘rlang’ successfully unpacked and MD5 sums checked
Warning in install.packages :
  unable to move temporary installation ‘C:\Users\durandeb\Documents\R\win-library\3.4\file332019c556fd\rlang’ to ‘C:\Users\durandeb\Documents\R\win-library\3.4\rlang’

The downloaded binary packages are in
    C:\Users\durandeb\AppData\Local\Temp\4\RtmpETJiDu\downloaded_packages      

你能帮助我一步一步地解决这个错误吗?我使用的是 Windows 10,我没有管理员权限,但我确实拥有上述文件夹的写入权限。

【问题讨论】:

  • this 问题可能重复。

标签: r windows installation deployment


【解决方案1】:

全局配置文件通常保存在 \etc 目录(文件夹)中 即

C:\Program Files\R\R-4.0.3\etc\Rprofile.site

编辑 Rprofile.site 在“#set a site library”部分下,默认库路径被注释掉。取消注释以下行,无论如何它都具有默认路径,如果您愿意可以更改其他内容,请继续执行。

# .Library.site <- file.path(chartr("\\", "/", R.home()), "site-library")

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-08-28
    • 2019-01-22
    • 2017-03-09
    • 1970-01-01
    • 1970-01-01
    • 2019-01-05
    • 2018-03-04
    相关资源
    最近更新 更多