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.2.0, the major version is 4 and the minor version is 2), 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?

You should take advantage of the pre-maintenance Preview cluster to do some testing. Because /home and /nfs directories are shared, we highly recommend that when you test you use copies of data and scripts.

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.2.0  Rtidyverse/4.2.0

Note that the lowest R version that will be available after maintenance (and on the preview clusters) is 4.2.0, whereas the highest version of R currently in production is 4.1.0. Since the minor version is different, you need to reinstall any packages that you will need for current and future work.

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

Because the available version of R is changing, 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.