Skip to main content

RStudio Server

Users can launch an RStudio Server instance on Palmetto through Open OnDemand. RStudio Server provides a web based RStudio environment.

RStudio Server page example

Starting a RStudio Server

  1. Go to the OpenOD website.

  2. Log in with your Palmetto user ID and password:

  3. Once you are logged in, click on Interactive Apps on the top navigation bar.

  4. Click on the RStudio Server link.

    Screenshot of the OpenOD website with the interactive apps tab open and the RStudio server option selected.

  5. Select the resources (CPU cores, memory, walltime, etc.) required for your session.

    Some R packages may require certain modules loaded. Be sure to include them in the "List of modules to be loaded". Some guidance is available below for module requirements for certain popular packages.

    info

    You must specify an exact module name and version that is available on our cluster. To determine the exact name and version, use the module avail command over an ssh session. If you specify a module that does not exist, no modules will be loaded.

    caution

    Changing the "List of modules to be loaded" in the resource selection form when launching RStudio may not immediately take effect if RStudio restores a previous session. To force the new modules to be available to RStudio, select Session->Restart R once RStudio is running.

    Screenshot of the RStudio server configuration page.

  6. Once you launch your server you will be taken to your current list of interactive sessions. Your job will be queued until resources are available to handle your request.

    Screenshot of the RStudio current list of interactive sessions page.

  7. Once your server has had it's resources allocated you can connect to your server with a button that says Connect to RStudio Server, your browser will then be sent to the RStudio interface.

Installing most packages in your RStudio server is as simple as running:

install.packages("package name")

These packages will install in your home directory and will be available for future RStudio sessions you run.

Some R packages require system libraries that may require loading libraries before installing. To check to see if this is needed, search the CRAN website for your package. If it lists SystemRequirement, these are system level libraries that must be loaded before the R package can be installed. For example, sf requires proj, gdal, geos, and sqlite3. These are already installed in the cluster as modules so you must add them in the "List of modules to be loaded" field before launching the R Studio Server in Open OnDemand. More examples and Palmetto cluster specific instructions for popular R packages follow.

rgdal

Required modules:

gdal/3.4.3-gcc/9.5.0

terra and sf

Required modules:

gdal/3.4.3-gcc/9.5.0 geos/3.9.1-gcc/9.5.0

Although the sqlite module is automatically loaded by gdal, configure scripts for terra and sf fail to find it. To install, you'll need to manually pass a configure argument:

install.packages('terra', configure.args=c('--with-sqlite3-lib=/software/spackages/linux-rocky8-x86_64/gcc-9.5.0/sqlite-3.38.5-3hfbzgprj52txgz7u4ipjy3mk7ubei2e/lib'))
install.packages('sf', configure.args=c('--with-sqlite3-lib=/software/spackages/linux-rocky8-x86_64/gcc-9.5.0/sqlite-3.38.5-3hfbzgprj52txgz7u4ipjy3mk7ubei2e/lib'))

lwgeom

Required modules:

gdal/3.4.3-gcc/9.5.0 geos/3.9.1-gcc/9.5.0

The sf package is a dependency for lwgeom and you may want to install it first.

Although the sqlite module is automatically loaded by gdal, configure script for lwgeom fails to find it. To install, you'll need to manually pass a configure argument.

install.packages("lwgeom", configure.vars=c("INLIBS='-L/software/spackages/linux-rocky8-x86_64/gcc-9.5.0/sqlite-3.38.5-3hfbzgprj52txgz7u4ipjy3mk7ubei2e/lib'"))

Rmpfr (required for many other packages like corHmm)

Required modules:

mpfr/4.1.0-gcc/9.5.0 gmp/6.2.1-gcc/9.5.0

The Rmpfr package cannot seem to find our cluster install of mpfr without some help. Add the following lines to the file ~/.R/Makevars (create the file and directory if needed):

LDFLAGS=-L/software/spackages/linux-rocky8-x86_64/gcc-9.5.0/mpfr-4.1.0-hvu35oswtwfhy5efq7x36m4zzcudeemr/lib

Now the standard install should work:

install.packages("Rmpfr")