FAQs
Why can't my R package be installed?
Luria has multiple versions of R available through the environment modules system. Sometimes, R packages install normally. However, other times there may be incompatibilities between the versions of R installed on Luria and the R package you're trying to install or a dependency that an R package needs is not installed on Luria.
In cases like this, you'll likely to need to use R from a Singularity image.
Using R from Singularity
The Rocker project creates OCI images that come pre-installed with R. Each image is geared toward a specific use-case. The r-ver images can be used for when you only need the R command line. The rest of the images come pre-installed with RStudio.
To use one of these images, follow these instructions on Luria:
module load singularity/3.10.4
# Replace 4.2.0 with the version of R you need.
# The first time this runs, Singularity will pull
# the image, which may take around 5 - 10 minutes.
# Subsequent times will be immediate. `-B /net:/net`
# is used to make sure your entire home directory is
# available inside of the container.
singularity exec -B /net:/net docker://rocker/r-ver:4.2.0 R
# You will now have an R 4.2.0 session running. Run
# install.packages("YOUR PACKAGE") and type "y" if
# R prompts you to create a user library
R>If you want to use R in a script, such as when writing a script to submit to Slurm, you'll need to first load Singularity, then replace any calls to Rscript with the full container invocation. For example:
The BioMicro Center has an image that contains R, RStudio, and the suite of Seurat tools preinstalled (asoberan/abrfseurat:20250910). To use this image, you can replace docker://rocker/r-ver:4.2.0 with docker://asoberan/abrfseurat:20250910 in the examples above.
Using RStudio from Singularity
You can take advantage of Singularity images that come with RStudio preinstalled to use RStudio on the cluster.
To use RStudio on the cluster, simply copy the following text into a file on the cluster. Name the file something relevant, such as rstudio.sh . Then, submit this file to Slurm using sbatch.
When running this file for the first time, give it about 7-10 minutes to download the Singularity image. After those 7-10 minutes, Slurm will create an output file that contains instructions at the top on how to access the RStudio server on your workstation's web browser.
For more information on Singularity, visit the following page:
Running Images in SingularityLast updated
Was this helpful?
