图书馆不可写 [英] 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库.安装看起来像这样: (此处以随机"作为示例包)
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.
更新18/01/19
如果您不想将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"的权限以便能够对其进行写入的选项.假设存在安全问题,但在我警告时还无法告知,但主要是在等待somone来解决此问题.同时,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屋!