Installing R packages local to your /home directory
To install R packages, first you must have an R module loaded with the command:
module load R/[version]
Then, create a local directory where your R packages will live. We suggest using something like:
/home/[user]/R/libs
Next, you will need to create a file in your /home/[user] directory called .Renviron
. This file will tell R where to look for your local packages. You will need to add the following line to this .Renviron file:
R_LIBS_USER="/home/[user]/R/libs
Once this file is present in your /home/[user]/ directory, you will be able to install R packages from the command line with the command:
install.packages("[R_Package_Name]")
If you have any questions or problems installing R packages, please email orcd-help-engaging@mit.edu