How can I install R packages in my home directory?
You may want to install R libraries that are not provided in MSI's R modules. You can install them to your home directory using the following procedure. Note that some packages need specific versions of external libraries such as gcc, gsl, fftw etc. These packages have to be loaded by using 'module load' command before using R, and may additionally need to be linked within R. You should be able to find these requirements in the package documentation if the packages are on CRAN - packages installed from source or via GitHub (e.g. using the package 'devtools') may have more sparse documentation.
If the following methods do not work for a package, please check the package documentation. Error messages during package installation (e.g. "cannot find ___") may also provide some information on system-level dependencies that should be loaded beforehand. For packages with an extremely long list of dependencies, you may want to consider installing them via conda/mamba as a stand-alone environment (many R packages are available via Anaconda.org). Please note that many advanced packages will take longer to install than the time you are limited to on a login node - you will want to request a compute node (interactive or non-interactive) for many package installations.