rstudio different library path to command-line R (`$R_LIBS_USER`)

You write:

Now I have set $R_LIBS_USER to ~/R/library in my bash profile,

Do you by chance call RStudio from a gui icon, ie without invoking your ~/.bash_profile ? Maybe you can try calling a wrapper instead which sets it?

For what it is worth, .libPaths() returns the same thing under RStudio Desktop and Server (though Server appends its internal directory), R on the command-line and via ESS for me.

Edit: And in general, do read help(Startup) which will be time well-spent. The comment by @flodel is quite appropriate. If you get lost dealing with this consistently at the system level, you can always turn to R, either at its system-level (via Renviron and Renviron.site) or via the ~/R/ directory.

Tags:

R

Rstudio