Using R
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 in order to provide users with several versions of the same software packages. To load an appropriate module for R, we must first identify which we want to use. 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, as follows:
$ 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
Other possible modules matches:
Armadillo Brotli Brunsli FriBidi GCCcore GDRCopy GObject-Introspection Ghostscript HarfBuzz JasPer JupyterLab JupyterNotebook LERC MPFR ...
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
To find other possible module matches execute:
$ module -r spider '.*R.*'
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
For detailed information about a specific "R" package (including how to load the modules) use the module's full name.
Note that names that have a trailing (E) are extensions provided by other modules.
For example:
$ module spider R/4.3.2-gfbf-2023a
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
We can then look at the details for a spcific 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
Help:
Description
===========
R is a free software environment for statistical computing
and graphics.
More information
================
- Homepage: https://www.r-project.org/
Included extensions
===================
abc-2.2.1, abc.data-1.0, abe-3.0.1, abind-1.4-5, acepack-1.4.1, adabag-4.2,
ade4-1.7-22, ADGofTest-0.3, admisc-0.31, aggregation-1.0.1, AICcmodavg-2.3-1,
akima-0.6-3.4, alabama-2022.4-1, AlgDesign-1.2.1, alluvial-0.1-2,
AMAPVox-1.0.0, animation-2.7, aod-1.3.2, apcluster-1.4.10, ape-5.7-1,
aplot-0.1.10, argparse-2.2.2, aricode-1.0.2, arm-1.13-1, askpass-1.1,
... [Truncated]
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.
>
Note that 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.