Posted on

在Rstudio中输入 .libPaths() 查看R调用的库

> .libPaths()
[1] "/cluster/home/jlu/R/x86_64-unknown-linux-gnu-library/3.5.1" "/usr/local/lib64/R/library"

重新设置R的默认库

> .libPaths(c("/cluster/apps/R/3.5.1/lib64/R/library", .libPaths())) 
# R包会默认安装到第一个路径下

> .libPaths()
[1] "/cluster/apps/R/3.5.1/lib64/R/library" "/cluster/home/jlu/R/x86_64-unknown-linux-gnu-library/3.5.1" 
[3] "/usr/local/lib64/R/library"

或者直接替换

> .libPaths("/cluster/apps/R/3.5.1/lib64/R/library") 

> .libPaths()
[1] "/cluster/apps/R/3.5.1/lib64/R/library"  #只保留公共库

作者:虚空纳鲁史爱民
链接:https://www.jianshu.com/p/c05f98f5d277
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

发表评论

邮箱地址不会被公开。 必填项已用*标注