Installing a new R release and a bundle of default user packages is streamlined with some scripts. This text is for administrators of the R installation. Other users may find some hints here, if their installation to $HOME fails.
Installing R
Make a new directory. It is strongly suggested, to follow the form /sw/viz/R/R-4.0.2/skl. Copy the installation scripts into this directory. Do not forget, other members of the sw-group may need to install here too.
$ cd /sw/viz/R/R-4.0.2/skl $ cp ../../scripts/* . $ chmod g+rwX *
Edit the script getR and update the version number. Run getR. This downloads the requested version of R, inflates und unpacks the tar-file and renames the source directory into build. Note, if you download otherwise, please rename the R-directory into build, if you want to use the script install_R.
$ ./get_R
- Check or edit the script install_R. You may change there:
- the default compiler to be used for building R and R packages. This compiler needs to be compatible with the compiler used for external packages like netcdf, openmpi, magick etc. If you change the default compiler, please change the other scripts too - see below.
- the options for running configure
- compiler options, especially the degreee of optimisation and rpath. These options will be part of the default settings to be used by Rscript when building packages.
- Run install_R. The script will stop several times requesting ENTER to continue. This helps to see, if the configuration, compilation and all checks are finished with reasonable output. Note, the script changes permissions in the end, to allow other members of the sw-group to install there too.
$ ./install_R
- Produce a module file. It should be sufficient, to copy that of the previous version and to change the version number in the file.
Install a single R-package
Before a package is installed, the correct compiler module must be loaded. Otherwise the system compiler is used. Since c++ is used a lot, this may result in an inconsistent package library. Package installation may be done with the help of Rscript or directly from R or rstudio. We recommend to use our scripts instead, since
- they load the default compiler compatible with R
- contain some fixes and workarounds needed to install some packages
- set the permissions for the installed files, which is often forgotten
- help with bookkeeping of package lists.
We support three different repositories:
- cran (https://cran.uni-muenster.de/): the main repository for releases of R package
$ ./install_cran <packagename>
- github: the detailed search for the package is done with githubinstall used by R.
$ ./install_github <packagename>
- BiocManager (https://www.bioconductor.org/install): a specific repository providing tools for the analysis and comprehension of high-throughput genomic data.
$ ./install_bioc <packagename> <version>
The version is optional.
If the installation is successful, the scripts prompt to ask for adding the package into a list of packages that will be installed by default with a new R version. In this case, one of the package lists in /sw/viz/R/package_list is updated, a copy of the previous list is stored in /sw/viz/R/package_list_save. These lists can be edited by hand.
To remove a package, you may use
$ ./remove_package <packagename>
Automatic removal from the list of default packages is not implemented yet.
Installing the default R-packages
To install the bundle of predefined R-packages, use the script install_packages. It
- loads the appropriate compiler module
- employs install_cran, install_github and install_bioc to install the packages
- sets the correct permissions for the installed files and libraries
$ ./install packages
The lists are located in /sw/viz/R/package_list. They can be maintained with any editor. They are the result of user requests in the past. They are over-complete, since many packages are installed in any case as prerequisite for other packages.