基于网络上的许多答案,我尝试了多种方法:
.libPaths():
[1] "/home/balter/conda/lib/R/library" "/home/balter/R"
> .library=""
> .library.site=c("")
> .libPaths()
[1] "/home/balter/conda/lib/R/library" "/home/balter/R"
> Sys.unsetenv("R_LIBS_SITE");Sys.unsetenv("R_LIBS");Sys.unsetenv("R_LIBS_USER")
> .libPaths()
> .libPaths()
[1] "/home/balter/conda/lib/R/library" "/home/balter/R"
> .libPaths("")
> .libPaths()
[1] "/home/balter/conda/lib/R/library"
> .libPaths("")
> .libPaths()
[1] "/home/balter/conda/lib/R/library"
> .library.site
[1] ""
> assign(".lib.loc", "")
> .libPaths()
[1] "/home/balter/conda/lib/R/library"
我希望能够将.libPaths
设置为空,或者至少完全设置为我想要的残差。