R .libPaths() difference between RStudio and command-line R R .libPaths() difference between RStudio and command-line R r r

R .libPaths() difference between RStudio and command-line R


Direct answer from the source:

http://support.rstudio.org/help/discussions/questions/204-r-libpaths-difference-between-rstudio-and-command-line-r

Hi there,

Yes, we have a custom R_LIBS_USER setting which is intended to make it easier to upgrade the server to a new version of R without requiring that every user rename their library directory and/or re-build their packages. That way the administrator can do an upgrade without fearing that they'll break their user's working environment (realize that this could also be accomplished by writing an upgrade script that does the requisite rename/rebuild for each user).

Fully agree that this isn't necessarily desirable in all cases. Here is what you can do to work around it:

The Rtudio Server R_LIBS_USER is controlled by the following setting in /etc/rstudio/rsession.conf:

r-libs-user=~/R/library

This variable supports the same wildcarding as R_LIBS_USER (as described here: http://stat.ethz.ch/R-manual/R-patched/library/base/html/libPaths.html) so you could change this to the following to make RStudio behave just like console R:

r-libs-user=~/R/%p-library/%v

(note I believe that is the right syntax to reproduce the directory shown in your output above but you'll definitely want to double check that)

Hope that clears things up and that you can get things configured as you'd like. Let us know if you have other questions or if this doesn't work as described.

J.J.


A quick googling got me here:

http://support.rstudio.org/help/discussions/problems/868-how-to-configure-libpaths

so it looks like RStudio uses its own libs, set in /etc/rstudio/rsession.conf. Why? Who knows.