Skip to main content

R

R is a free software environment for statistical computing and graphics. R provides a wide variety of statistical (linear and nonlinear modelling, classical statistical tests, time-series analysis, classification, clustering, …) and graphical techniques, and is highly extensible.

R is an integrated suite of software facilities for data manipulation, calculation and graphical display. It includes

an effective data handling and storage facility, a suite of operators for calculations on arrays, in particular matrices, a large, coherent, integrated collection of intermediate tools for data analysis, graphical facilities for data analysis and display either on-screen or on hard copy, and a well-developed, simple and effective programming language which includes conditionals, loops, user-defined recursive functions and input and output facilities.

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 a 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