R

R is the reference and most popular R interpreter/environment. The interpreter’s program name is simply R. In all software stacks, the module name is r. To load a specific version, run

module load r/VERSION

To load the default version, run

module load r

Description

R is a language and environment for statistical computing and graphics. It is a GNU project which is similar to the S language and environment which was developed at Bell Laboratories (formerly AT&T, now Lucent Technologies) by John Chambers and colleagues. R can be considered as a different implementation of S. There are some important differences, but much code written for S runs unaltered under R.

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. The S language is often the vehicle of choice for research in statistical methodology, and R provides an Open Source route to participation in that activity.

Read more on the R project home page.

Modules

The following versions are available via the unified GWDG Modules.

List of Modules

Node TypeModule NamesRequirements (Load First)
Grete (GPU)r/4.4.0
r/4.4.1
r/4.5.2
gcc/13.2.0
Emmy (CPU)r/4.4.0
r/4.4.1-q57tyhq
gcc/11.5.0
Emmy (CPU)r/4.4.1
r/4.5.2
gcc/14.2.0

Prerequisites

For the installation of R packages using Rscript, the appropriate compiler module must be loaded in addition to the R module. You can check which compiler was used for a given R version by running module show r/VERSION.

RStudio

RStudio is available as an interactive application through JupyterHPC. Select RStudio under HPC Application when launching a session. This is the recommended way to use RStudio on the GWDG HPC cluster.

Running R on compute nodes

Allocate an interactive session on a compute node:

$ salloc -N 1 -p large96
$ squeue --job <jobID>

The output of salloc shows your job ID. With squeue you see the node assigned to you. Log in with X11-forwarding:

$ ssh -X <nodename>

Load a module file and work interactively as usual. When finished, free the resources:

$ scancel <jobID>

Alternatively, use srun directly:

$ srun -v -p large96 --pty --interactive bash

Do not forget to free the resources when ready.

R Packages

List of installed R packages

To see all packages installed for your loaded R version, run installed.packages() inside R. Please contact support to request additional packages be installed system-wide.

Users may also request package installation via support or install packages in their HOME directory.

Building R packages

Users may install their own packages in the HOME directory using Rscript. R packages must be built with the same compiler as R itself was built with. You can check the compiler used by running module show r/VERSION

Packages can be installed from three main sources:

  • CRAN - the main repository for R packages:
  install.packages("packagename")
  BiocManager::install("packagename")
  • GitHub - for development versions of packages:
  devtools::install_github("user/packagename")

Documentation