我有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中不起作用).
找到解决方案:在文件中/usr/lib/R/etc/Renviron有一个R的配置.
在第43-45行中有:
# edd Jun 2017 Comment-out R_LIBS_USER
#R_LIBS_USER=${R_LIBS_USER-'~/R/x86_64-pc-linux-gnu-library/3.4'}
##R_LIBS_USER=${R_LIBS_USER-'~/Library/R/3.4/library'}
Run Code Online (Sandbox Code Playgroud)
我没有注释R_LIBS_USER=${R_LIBS_USER-'~/R/x86_64-pc-linux-gnu-library/3.4'},重新启动RStudio现在它的工作原理.
编辑:看看评论,这似乎是一个计划的行为.这是另一种解决方案.
| 归档时间: |
|
| 查看次数: |
912 次 |
| 最近记录: |