Using R
As an example, if you want to run R from the terminal, you will find that R is not available in your PATH by default:
$ R
-bash: R: command not found
This is because the cluster uses modules to provide users with several versions of the same software packages. To load an appropriate module for R, we must first identify which version we want. The command module avail may be used to list all modules, but we can be more specific and use module spider R to search specifically for R:
$ module spider R
-------------------------------------------------------------------
R:
-------------------------------------------------------------------
Description:
R is a free software environment for statistical computing and graphics.
Versions:
R/4.1.2-foss-2021b
R/4.2.1-foss-2022a
R/4.2.2-foss-2022b
R/4.3.2-gfbf-2023a
We can then look at the details for a specific version:
$ module spider R/4.2.2-foss-2022b
-------------------------------------------------------------------
R: R/4.2.2-foss-2022b
-------------------------------------------------------------------
Description:
R is a free software environment for statistical computing
and graphics.
This module can be loaded directly: module load R/4.2.2-foss-2022b
More information:
- Homepage: https://www.r-project.org/
To load the module, we use module load R/4.2.2-foss-2022b, which will immediately give us access to R:
$ module load R/4.2.2-foss-2022b
$ R
R version 4.2.2 (2022-10-31) -- "Innocent and Trusting"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
>
While this example loaded the R module and started the application on the login node, no jobs or work should be executed or performed on the login node. All jobs — including software/library installation — should be performed on a compute node via Slurm. See Submitting Jobs with Slurm.