Using R on Red Hat 8

What’s Changing?

Not all versions of R currently installed on ARC clusters will be available after the update from CentOS 7 to Red Hat 8 in August.

Why that matters

Any scripts that load a version-specific R module will likely have to be updated to specify a version that is available on the updated cluster.

R packages are installed for the specific version of R that is in use during installation. If you switch from using a module for one version of R to a different one with where either the major or minor version changes (for R/4.0.2, the major version is 4 and the minor version is 0), then you will have to re-install any packages in order to make them available in the library of the new version of R.

You only need to install R packages once for each cluster on which you wish to use the library and, separately, for each version of R that you use.

What should I do?

Check available versions

Log onto the Preview cluster prior to maintenance and use the following command (the $ is the prompt; do not type it):

$ module -r available ‘^R.*’

The output from that command will show available options (versions subject to change) as follows:

R/4.1.2  Rtidyverse/4.1.2

Note that the lowest R version is 4.1.2, so if packages were previously installed with an R of a version lower than 4.1, you will need to reinstall those packages.

Update version of R module being loaded

You should modify version numbers in any of your scripts that load R modules, as appropriate. ARC recommends that you take advantage of the Preview cluster during the pre-maintenance period to review changes in available module versions and to run some test jobs with your revised scripts.

Re-install user-installed packages

If you have previously been using any version of R that is less than 4.1, you will need to re-install R packages after the update. The general procedure is to load the R module, then run R. From the R prompt, use:

> install.packages('package_name')

The first time you install a package, you will be asked if you want to install it to a personal library, and you do, so say ‘yes’. It will also offer to create one at ~/R/x86_64-pc-linux-gnu-library/?.?, where ?.? represents the versioning of the R release.

The package will then be available to you for this and future sessions.