R packages in `/usr/` vs. `~/R/` , specifically within the `r2u` framework

49 Views Asked by At

I am relatively new to Linux (currently using Linux Mint 21.2). Looking at other SO posts, it seems common that the R command .libPaths() returns 1-3 paths, all sub-directories of /usr/ (namely, [2]-[4] below). However, when I run .libPaths(), I get the following:

[1] "/home/<user>/R/x86_64-pc-linux-gnu-library/4.3"
[2] "/usr/local/lib/R/site-library"                   
[3] "/usr/lib/R/site-library"                         
[4] "/usr/lib/R/library"  

I have not seen many people list a home directory in their .libPaths. This is fine, but I would think this would be more common, since it's mentioned in the CRAN documentation on R packages in Ubuntu:

In order to find packages, R looks at the variables R_LIBS_USER and R_LIBS_SITE. On Debian and Ubuntu, R_LIBS_USER is set in /etc/R/Renviron to

R_LIBS_USER=${R_LIBS_USER-'~/R/$platform-library/3.5'}

where $platform is something like ‘x86_64-pc-linux-gnu’ and depending on the version of R installed.

I have also just installed r2u for installing R package binaries rather than building them from source. However, now it seems there is a discrepancy which worries me:

  • RStudio reports that all packages are up to date
  • Mint's Update Manager (apt-based) says there are 113 R packages which need to be updated

So, what is my question?

  1. Any help in understanding the packages in ~/R/ versus the other /usr/ spaces would be helpful.

  2. Should I be worried that I have two completely R package libraries? Is there a way to safely merge them?

  3. Is there a way to omit the R package updates from my Update Manager GUI? I don't really want the constant notifications of R-package updates.

Thank you in advance.

0

There are 0 best solutions below