0

I am using ubuntu 14.04. I want to set up myself just one library path for R where all of the packages would be installed. I tried setting up environment variables R_LIBS, R_LIBS_USER in .bash_profile (of course running source ~/.bash_profile afterwards), tried adding .libPaths(.libPaths()[1]) to Rprofile.site, but the only thing that I achieve is that my own library is added to 3 other already present ones. Due to this I am getting errors when some packages are from other R version that was previously installed. I want to leave just one library path and prevent R from searching in all others. I found several threads about the issue but neither of them worked for me:

Remove a library from .libPaths() permanently without Rprofile.site

https://community.rstudio.com/t/reinstalling-packages-on-new-version-of-r/7670

I can try just uninstalling all of the packages and reinstalling them over, but I kind of want everything to be structured and organized anyway. I do not like very much that R shuffles libraries into different folders and want to have just one or max two that were defined solely by me.

Nikita Vlasenko
  • 4,004
  • 7
  • 47
  • 87
  • You should try modifying [R_LIBS_SITE](https://stackoverflow.com/questions/24387660/how-to-change-libpaths-permanently-in-r). – Anonymous coward Sep 25 '18 at 22:09
  • That almost worked: I set this environment variable, but still one path remained: `/usr/lib/R/library` – Nikita Vlasenko Sep 25 '18 at 22:25
  • That should be your `base` library. The other one you specified is essentially your `repo` sourced library. See the [Debian R policy](https://cran.r-project.org/bin/linux/debian/#debian-r-policy) for specifics. – Anonymous coward Sep 25 '18 at 22:29
  • https://csgillespie.github.io/efficientR/3-3-r-startup.html#renviron – Tung Sep 25 '18 at 22:31
  • I can not eliminate the last base library still, and so probably that is the reason why I can not fix the error of the R packages installed for the previous version of R. – Nikita Vlasenko Sep 25 '18 at 23:42

0 Answers0