R
R - statistical computing and graphics
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
Version | Build Date | Installation Path | modulefile | compiler |
---|---|---|---|---|
R 3.5.1 (gcc) | 06-oct-2018 | /sw/viz/R/3.5.1 | R/3.5.1 | gcc/8.2.0.hlrn |
R 3.6.2 (gcc) | 05-feb-2020 | /sw/viz/R/3.6.2 | R/3.6.2 | gcc/7.5.0 |
R 4.0.2 (gcc) | 18-aug-2020 | /sw/viz/R/4.0.2 | R/4.0.2 | gcc/8.3.0 |
rstudio 0.98.1102 | 01-Aug-2014 | /sw/viz/R/rstudio_1.1.453 |
For a manual consult the R home page.
Prerequisites
For the installation of R-packages by users with the help of rstudio or Rscript, the appropriate compiler module must be loaded in addition to the R-module.
R at HLRN
Modules
Before starting R, load a modulefile
module load R/version
This provides access to the script R that sets up an environment and starts the R-binary. The corresponding man - and info pages become available.
Info pages: R-admin, R-data, R-exts, R-intro, R-lang, R-admin, R-FAQ, R-ints
As programming environment, rstudio Version 1.1.453 is installed and available, when a module file for R is loaded. rstudio starts the version of R specified with the module file.
Running R on the frontends
This is possible, but resources and runtime are limited. Be friendly to other users and work on the shared compute nodes!
Running R on the compute nodes
Allocate capacity in the batch system, and log onto the related node:
$ salloc -N 1 -p large96:shared $ squeue --job <jobID>
The output of salloc
shows your job ID. With squeue
you see the node you are going to use. Login with X11-forwarding:
$ ssh -X <nodename>
Load a module file and work interactively as usual. When ready, free the resources:
$ scancel <jobID>
You may also use srun:
$ srun -v -p large96:shared --pty --interactive bash
Do not forget to free the resources when ready.
R packages
List of installed R packages
The following packages are installed by default, when a new version of R is build. Please contact support to extend this list.
Users may request package installation via support or install in their HOME - directory.
Building R-packages - users approach
Users may install their own packages in the HOME-directory from the rstudio gui or using Rscript. R-packages must be build with the same compiler as R itself was build, see the table above. This happens, when Rscript is used and the appropriate compiler module is loaded.
Building R-packages - administrators approach
R administrators may use rstudio or Rscript for installation. For installing packages in /sw/viz/R it is suggested, to use Rscript like
$ Rscript -e 'install.packages("'$package'",repos="'$REPOSITORY'",INSTALL_opts="--html")'
Using INSTALL_opts="--html" keeps documentation of installed packages up to date!
This becomes rapidly work intensive, when installing a huge bundle of packages or even the package set for a new R release. For convenience, we maintain a list of default packages and scripts to install them all. These are located in the installation directory:
- install_packages,
- install_cran
- install_github
- install_bioc
- remove_package,
- sync_wiki
Here also the workarounds are collected needed to install stiff packages, whose developers do not care and do not support all Rscript options.