Packages that you want to share with others in your project space
On teton, do the following steps. At the UNIX command prompt, where you will need to substitute your project name for MYPROJECTNAME:
mkdir -p /project/MYPROJECTNAME/share/Rlibs/r4.0/
module load swset/2018.05 gcc/7.3.0 r/4.0.5-py27
R
Then, as below, within R and at its prompt, first prepend the new directory for R packages to the libPaths variable. This directory will be your primary directory and the system-wide, administrator controlled directory will be secondary.
Then install a package (here the wesanderson color palette and load the library.
.libPaths("/project/MYPROJECTNAME/share/Rlibs/r4.0/")
install.packages("wesanderson")
library(wesanderson)
In future sessions, you or another member of your research project group will be able to start an R session and simply do the following to use this package (after substituting your project name for MYPROJECTNAME).
.libPaths("/project/MYPROJECTNAME/share/Rlibs/r4.0/")
library(wesanderson)
Packages that only need to be accessible to you
If R packages can reside in your personal workspace (home directory), you can do the following.
Load R:
module load swset/2018.05 gcc/7.3.0 r/4.0.5-py27 R
In R, install the package you want. It will be installed in ~/R/x86_64-pc-linux-gnu-library/4.0 by default.
install.packages("wesanderson")
library(wesanderson)