gpt4 book ai didi

r - 安装r包代码工具时出错

转载 作者:行者123 更新时间:2023-12-04 12:05:34 24 4
gpt4 key购买 nike

我尝试更新 codetools 包并在使用 update.package() 或 install.package() 时遇到相同的错误,如下所示。任何见解都值得赞赏:

R> install.packages("codetools", lib = "/usr/lib/R/library")
trying URL 'https://cran.rstudio.com/src/contrib/codetools_0.2-14.tar.gz'
Content type 'application/x-gzip' length 12938 bytes (12 KB)
==================================================
downloaded 12 KB

* installing *source* package ‘codetools’ ...
** package ‘codetools’ successfully unpacked and MD5 sums checked
mv: cannot move ‘/usr/lib/R/library/codetools’ to ‘/usr/lib/R/library/00LOCK-codetools/codetools’: Permission denied
Warning in file.copy(f, instdir, TRUE) : problem copying ./NAMESPACE to /usr/lib/R/library/codetools/NAMESPACE: Permission denied
Warning in file(file, ifelse(append, "a", "w")) : cannot open file '/usr/lib/R/library/codetools/DESCRIPTION': Permission denied
Error in file(file, ifelse(append, "a", "w")) : cannot open the connection
ERROR: installing package DESCRIPTION failed for package ‘codetools’
* removing ‘/usr/lib/R/library/codetools’
Warning in install.packages : installation of package ‘codetools’ had non-zero exit status

The downloaded source packages are in
‘/tmp/RtmpiJWb8L/downloaded_packages’
Updating HTML index of packages in '.Library'
Warning in install.packages : cannot create file '/usr/share/R/doc/html/packages.html', reason 'Permission denied'
Warning in install.packages : cannot update HTML package index

最佳答案

权限被拒绝听起来好像您没有该系统的管理员权限。尝试以 root 身份运行 R(或使用 sudo),看看它是否有效。

关于r - 安装r包代码工具时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32420581/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com