I am trying to understand why my .libPath is different between the R command line and RStudio Desktop (NOTE: this is not a duplicate of this question , since this fix is ββrelated to material specific to RStudio Server that I do not have).
When I use R on the command line (linux):
> .libPaths() [1] "/home/mathematicalcoffee/R/library" "/usr/local/lib/R/site-library" [3] "/usr/lib/R/site-library" "/usr/lib/R/library"
When I use RStudio Desktop (linux, same computer):
[1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library" "/usr/lib/R/library" "/usr/lib/rstudio/R/library"
Now I set $R_LIBS_USER to ~/R/library in my bash profile, so R-command-line selects it as my preferred libPath.
The problem is in RStudio Desktop when I do this:
Sys.getenv('R_LIBS_USER')
So why did RStudio Desktop change my R_LIBS_USER ? How can i change it? (I do not use the .Rprofile file). (In the question I linked above, the solution for RStudio Server was to change /etc/rstudio/rsession.conf , but I donβt have it, because I have RStudio Desktop. In addition, I believe that RStudio should respect my variable environment R_LIBS_USER ).
mathematical.coffee
source share