Remotely specify default library path in RStudio Server Open Source

I'm running RStudio Server Open Source (version 2021.09.0+351, Ghost Orchid) on a Linux server (Ubuntu, 18.04. 6 LTS, Bionic Beaver). I have 2 accounts on the server, both of which have sudo privileges. I'm trying to update the default R library path on one of the accounts (using the "Tools/Install libraries..." dialog; see here), but when I open the dialog in RStudio, I cannot specify a different library path. To address this, I'm trying to run RStudio Server as an admin remotely on my server. How do I do this?

I could not find a solution to this in the RStudio Server documentation. This page recommends specifying the r-libs-user field in the /etc/rstudio/rsession.conf file; however, even after doing this and restarting rstudio-server, the default library path for the user in question remains unchanged.

Thanks for any help.

You can change the default library folder by setting your R_LIBS_SITE and/or R_LIBS_USER environmen variables in a .Reviron or .Rprofile file. For example:

# In a .Renviron file you can set it by adding a line like this one with the desired location 
R_LIBS_SITE="C:\\Program Files\\R\\R-4.1.2\\library"

For a more detailed explanation, you can read this blog post

1 Like

Thanks for these recommendations. I ultimately addressed this by specifying the .libPaths value in my .Rprofile, to a shared directory I created

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.