Version specific user libraries in RStudio Server Pro

We currently use R 3.4.4 with RStudio Server Pro, due to difficulties with package libraries after a previous attempted upgrade to R 3.5.0. We would now like to upgrade to R 3.6.0, but I am struggling to ensure that different user libraries are used for different (major) versions of R in RStudio Server Pro. I have attempted amending rsession.conf to specify r-libs-user=~/R/library/%v instead of r-libs-user=~/R/library but this attempts the creation of a folder named '%v' instead of the intended version number replacement for this specifier. Please help?

1 Like

How are you installing R? Are you installing from source, with multiple versions side-by-side?

RStudio Server Pro supports multiple versions, and we usually recommend adding versions of R, not replacing R. https://docs.rstudio.com/ide/server-pro/r-versions.html#installing-multiple-versions-of-r

Re: user library paths, you shouldn't need to do anything special - R will automatically create a different library for each version on R on Linux (this behavior is different on desktops). For example, without any settings, I have:

# in a session using R 3.4.4
.libPaths()
# "/home/sean/R/x86_64-pc-linux-gnu-library/3.4" "/opt/R/3.4.4/lib/R/library"
# in a session using R 3.5.0
.libPaths()
# "/home/sean/R/x86_64-pc-linux-gnu-library/3.5" "/opt/R/3.5.0/lib/R/library" 

This is without setting r-libs-user at all.

Finally, you might find this information useful if you are also managing a site library:

Thanks for the reply @slopp, it is installed from source on Unix and the problem appears to be an RStudio behaviour I want to prevent rather than an R setting, as I believe that the default R setting would do what I desire (append major version number to library path)?

@matthawktw the example above demonstrates that RStudio Server Pro respects the default R behavior you are looking for. To troubleshoot further I'd suggest emailing support@rstudio.com.

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