Change R default library path using .libPaths in Rprofile.site fails to work

后端 未结 15 2844
青春惊慌失措
青春惊慌失措 2020-11-22 06:27

I am running R on Windows, not as an administrator. When I install a package, the following command doesn\'t work:

> install.packages(\"zoo\")
Installing          


        
15条回答
  •  春和景丽
    2020-11-22 07:03

    If you want to change your library path permanently (without calling .libPath() every time when entering in R, this works for me:

    1. create .Rprofile under your home directory. (~/.Rprofile)

    2. type .libPaths(c( .libPaths(), "your new path" )) in .Rprofile file, save.

    3. open R (any directory) and check, just type .libPaths(), you can find your libaray path is updated!

提交回复
热议问题