1

I had an issue on changing the R library on linux. The command I typed in is not working.

sudo R -e ".libPaths()"

.libPaths()

[1] "/usr/lib64/R/library" "/usr/share/R/library"

sudo R -e ".libPaths(c(.libPaths(), '/usr/test'))"

.libPaths(c(.libPaths(), '/usr/test'))

After that, if I re-run sudo R -e ".libPaths()", I will get the same default path without the new path I added.

Jian
  • 365
  • 1
  • 6
  • 19
  • Changes to `.libPaths()` are not persistent across R sessions. See the `?Startup` help pages for the different files that are checked at startup where you can place settings such as the library paths so that future R sessions will use those settings. – MrFlick Jun 15 '18 at 18:30
  • Thanks for the link, which I missed during my initial search. Here is what I did. `cd /usr/lib64/R/etc`, `sudo vim Renviron`, add your directory to `R_LIBS_SITE`. – Jian Jun 15 '18 at 19:28

0 Answers0