库不可写 [英] Library is not writable
问题描述
我在 Ubuntu 机器上安装 R 版本 3.0.2 (2013-09-25) 时遇到此问题:
I have this issue during package installation in R version 3.0.2 (2013-09-25) on an Ubuntu machine:
install.packages("randomForest")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning in install.packages :
'lib = "/usr/local/lib/R/site-library"' is not writable
如何解决?
推荐答案
对于 R 版本 3.2.2 (2015-08-14) 应该解决这个问题,因为 R 在安装过程中建议使用不同的路径来存储 R图书馆.安装看起来像这样:(这里以'random'作为示例包)
For R version 3.2.2 (2015-08-14) this problem should be dealt with since R suggests within the installation process a different path to store your R libraries. The installation looks like this: (Here 'random' is used as an example package)
install.packages('random')
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning in install.packages("random") :
'lib = "/usr/local/lib/R/site-library"' is not writable
Would you like to use a personal library instead? (y/n) y
Would you like to create a personal library
~/R/pc-linux-gnu-library/3.2
to install packages into? (y/n) y
所以在安装过程中用y"回答这两个问题应该正确安装包.
So during the installation answering both questions with 'y' should install the package correctly.
2019 年 1 月 18 日更新
如果您不想将 R 包存储在其他文件中:
In case you don't want to store your R packages in an additional file:
作为 Antoine-Sac 和 Robert TheSim 指出您可以将自己添加到员工组中,以便能够写入站点库".(点击名字可以看到他们的重要补充)
As Antoine-Sac and Robert TheSim point out you can add yourself to the staff group in order to be able to write to 'site-library'. (Click on the names to see their important additions)
在此更新之前,我在此评论中提到了使用chmod o+w"更改文件夹site-library"权限的选项,以便能够对其进行写入.假设存在安全问题,但当时我无法告诉我警告,但主要是在等待某人解决这个问题.Antoine-Sac 和 Robert TheSim 同时这样做了.谢谢!
Before this update I mentioned in this comment the option of changing the permission of the folder 'site-library' using 'chmod o+w' in order to be able to write to it. Assuming security issues but unable to tell at the time I warned about it but have primarily been waiting for somone to clear this up. Antoine-Sac and Robert TheSim have done so in the meantime. Thanks!
这篇关于库不可写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!