我在Ubuntu机器上的R 3.0.2(2013-09-25)软件包安装过程中遇到此问题:
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
Run Code Online (Sandbox Code Playgroud)
怎么解决?
我有Ubuntu 16.04,在更新R到3.4.1版之后,即使它们也已更新,它也看不到我的包:
> library(dplyr)
Error in library(dplyr) : there is no package called ‘dplyr’
Run Code Online (Sandbox Code Playgroud)
包裹在那里:
$ ls ~/R/x86_64-pc-linux-gnu-library/3.4/ | grep plyr
dplyr
plyr
Run Code Online (Sandbox Code Playgroud)
我的.libPaths:
> .libPaths()
[1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library" "/usr/lib/R/library"
Run Code Online (Sandbox Code Playgroud)
设置.libPaths到所需的路径只会为一个会话.我希望它是永久性的.
我也尝试设置变量R_LIBS,R_LIBS_SITE并设置R_LIBS_USER到此处所示的所需路径,但它仅在控制台中起作用(在RStudio中不起作用).