Skip to main content

R

R is a free, open-source programming language and software environment for statistical computing, data analysis, and visualization. It includes extensive tools for statistical modeling, matrix computations, graphics, and data manipulation, and can be extended through thousands of community-contributed packages.

Installation Method

Installation MethodRecommended
Module Yes
Container Yes
Conda Yes
Source No

Module

module load r

Container

apptainer run docker://rocker/r-ver:<version>

Conda

module load miniforge3
conda create -n custom-r-env
source activate custom-r-env
conda install -c conda-forge r r-essentials <other R packages>

Running R Jobs

Interactive

To run the interactive R console:

salloc -n1 --mem=4G -t 60
module load r
R

Batch

To run an R script (code.R) in a batch job:

#!/bin/bash
#SBATCH --job-name <job-name>
#SBATCH --ntasks=1
#SBATCH --mem=4G
#SBATCH --time=1:00:00

module load r
Rscript code.R