安装RStudio之后,我跑了:
library()
Warning message:
libraries ‘/usr/local/lib/R/site-library’, ‘usr/lib/R/site-library’ contain no packages
然后我输入:
.libPaths()
[1] "/home/avalon/R/x86_64-pc-linux-gun-library/3.2"
[2] "/usr/local/lib/R/site-library"
[3] "/usr/lib/R/site-library"
[4] "/usr/lib/R/library"
如何删除[2]和[3]以防止再次出现警告消息?
预期产量:
.libPaths()
[1] "/home/avalon/R/x86_64-pc-linux-gun-library/3.2"
[4] "/usr/lib/R/library"
解决方法:
Linux的
首先要做的是阅读它上面的联机帮助页(?.libPaths),你会看到:
‘.libPaths’ is used for getting or setting the library trees that R knows about (and hence uses when looking for packages). If called with argument ‘new’, the library search path is set to the existing directories in unique(c(new, .Library.site, .Li