尝试在RStudio
上的macOS Catalatina,
内安装软件包时,失败并出现Permission Denied
错误:
> install.packages("mlbench")
trying URL 'https://cran.rstudio.com/src/contrib/mlbench_2.1-1.tar.gz'
Content type 'application/x-gzip' length 920768 bytes (899 KB)
==================================================
downloaded 899 KB
* installing *source* package ‘mlbench’ ...
** package ‘mlbench’ successfully unpacked and MD5 sums checked
mv: rename /usr/local/Cellar/r/3.6.1_1/lib/R/library/mlbench to /usr/local/Cellar/r/3.6.1_1/lib/R/library/00LOCK-mlbench/mlbench: Permission denied
ERROR: cannot remove earlier installation, is it in use?
* removing ‘/usr/local/Cellar/r/3.6.1_1/lib/R/library/mlbench’
Warning in install.packages :
installation of package ‘mlbench’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/bc/wsz930gj3gn5zgq4hbm6jkfr0000gn/T/RtmpdvQLox/downloaded_packages’
Updating HTML index of packages in '.Library'
Warning in install.packages :
cannot create file '/usr/local/Cellar/r/3.6.1_1/lib/R/doc/html/packages.html', reason 'Permission denied'
Warning in install.packages :
cannot update HTML package index
答案 0 :(得分:0)
如RStudio支持here所述:
您可以在R中安装软件包吗?
如果遇到问题,建议您尝试在R中安装软件包 (在RStudio之外),看看您是否能够做到这一点。如果没有,请 请在下面查看可能的解决方案。
因此,需要:
Terminal.app
,sudo R
,install.packages("mlbench")
。