Rstudio Server Pro and R_LIBS_SITE works but not on the Free version. NOT SUPPORTED?.


Essentially we use the RStudio Pro version and R_LIBS_SITE works but in the open source version does not work, so when assigning a value to this variable it gets lost in the free version. Wondering if I have missed anything or it is simply not supported in the free version.

RStudio Free version: 1.3.1073
Executed as a normal user.
module load R
Module list: Tested using 3.5.1 and 4.0.2 of R
---------------------------------------------------------------- /config/modulefiles -----------------------------------------------------------------
R/3.2.5 R/3.3.1 R/3.5.1 R/4.0.2(default) RStudio/1.3.1073(default)
R/3.3.0 R/3.4.0 R/3.6.0 RStudio/1.2.5

Module .base:

$name modulefile

set ver [lrange [split [ module-info name ] / ] 1 1 ]
set name [lrange [split [ module-info name ] / ] 0 0 ]
set loading [module-info mode load]
set desc [join [read [ open "/config/modulefiles/$name/.desc" ] ] ]

proc ModulesHelp { } {
puts stderr "\tThis module sets the environment for $name v$ver"


if { [module-info mode load] } {

    set logmsg "load $name $ver"
    set ret [exec logger -t MODULE $logmsg]

} elseif { [module-info mode remove] } {
set logmsg "unload $name $ver"
set ret [exec logger -t MODULE $logmsg]
} else {
set m [module-info mode]
set logmsg "$m $name $ver"
set ret [exec logger -t MODULE $logmsg]

end logging

module-whatis "$desc (v$ver)"

switch $ver {
module load java/1.8.0_171-jre
prepend-path LD_LIBRARY_PATH /config/binaries/java/1.8.0_171-jre/jre/lib/amd64/server
module load hdf5/1.10.5
module load gsl/2.1
module load jags/4.3.0
module load gcc/8.3.0
module load gdal/3.1.2
module load java/1.8.0_171-jre
module load hdf5/1.8.21
module load java/1.8.0_171-jre
module load hdf5/1.8.21
module load gsl/2.1
module load java/1.8.0_144-jre
module load java/1.8.0_144-jre
module load java/1.7.0_80

prepend-path R_HOME /config/binaries/$name/$ver/lib64/R
prepend-path R_DOC_DIR /config/binaries/$name/$ver/lib64/R/doc
prepend-path R_SHARE_DIR /config/binaries/$name/$ver/lib64/share
prepend-path R_LIBS_SITE /config/binaries/$name/$ver/R_libraries
prepend-path LD_LIBRARY_PATH /config/binaries/$name/$ver/lib64/R/lib
prepend-path LIBRARY_PATH /config/binaries/$name/$ver/lib64
prepend-path PATH /config/binaries/$name/$ver/bin

***Execution from my normal bash shell:
% module load R
% module list

Currently Loaded Modulefiles:

  1. java/1.8.0_171-jre 3) gsl/2.1 5) gcc/8.3.0 7) gdal/3.1.2
  2. hdf5/1.10.5 4) jags/4.3.0 6) java/1.7.0_80-jdk 8) R/4.0.2

% R
R version 4.0.2 (2020-06-22) -- "Taking Off Again"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.


R_HOME /config/binaries/R/4.0.2/lib64/R
R_INCLUDE_DIR /config/binaries/R/4.0.2/lib64/R/include
R_LIBS_SITE /config/binaries/R/4.0.2/R_libraries
Stuff deleted...

Now from the RStudio Server Free console:
R_LIBS_SITE = "", R_LIBS_USER = "~/R/x86_64-pc-linux-gnu-library/4.0",

From this you see the R_LIB_SITE Value is lost.

Here is the RStudio server startup script
Script starting...
Waiting for RStudio Server to open port 32759...
Currently Loaded Modulefiles:

  1. RStudio/1.3.1073 4) gsl/2.1 7) java/1.7.0_80-jdk
  2. java/1.8.0_171-jre 5) jags/4.3.0 8) gdal/3.1.2
  3. hdf5/1.10.5 6) gcc/8.3.0 9) R/4.0.2


Starting up rserver...

  • rserver --www-port 32759 --auth-none 0 --auth-pam-helper-path /home/fredblog/ondemand/data/sys/dashboard/batch_connect/dev/bc_rcc_rstudio_server/output/eb63c0e8-63ee-4d2e-ac48-0dcb034b1bbb/bin/auth --auth-encrypt-password 0 --rsession-path /home/fredblog/ondemand/data/sys/dashboard/batch_connect/dev/bc_rcc_rstudio_server/output/eb63c0e8-63ee-4d2e-ac48-0dcb034b1bbb/ --server-data-dir /tmp --secure-cookie-key-file /tmp/rstudio-server/secure-cookie-key

So from above script you can see (yes the “R_LIBS_SITE” is explicitly exported in my start script):

So in the RStudio free console this value is lost. Not the case with Pro as It worked as expected.

Is there some kind of bug or is “R_LIBS_SITE” not supported in the free version of RStudio?
Any workaround? Thx


Hi folks,
Anyone able to help me out here? Thx

The R_LIBS_SITE variable is read by R, so it is supported in all versions of RStudio. However, the method by which you are setting the variable (via a startup script or an environment module) is only available in Pro. The free version does not run startup scripts or environment modules, nor does it support multiple versions of R.

For your use case I don't think you'll be happy with the free version, but if you want to experiment further, you might try setting R_LIBS_SITE in your site-wide Renviron file.

This topic was automatically closed 21 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.