Print
1. Create a directory “R_libs” in your home and then export to your BASH environment.

# mkdir /home/[your_user_id]/R_libs

# cd /home/[your_user_id]/R_libs

# export R_LIBS="/home/[your_user_id]/R_libs"

2. Include the R module of Jade

# module add gcc/4.9.3 

# module add bzip2/1.0.6/gcc/4.9.3

# module add pcre/8.39/gcc/4.9.3

# module add zlib/1.2.8/gcc/4.9.3

# module add xz/5.2.2/gcc/4.9.3

# module add libcurl/7.49.1/gcc/4.9.3

# module add R/3.3.1/gcc/4.9.3

# module add autoconf/2.67/gcc/4.9.3

3. Run R

# R

4. In the R workspace, you can see the new library path points to your home library path instead of the system library path

> .libPaths();

[1] “/home/[your_user_id]/R_libs”
[2] “/share/apps/R/3.3.1/gcc/4.9.3/lib64/R/library”

5. Now, you can install R package in your home directory. Here is an example for installing “ggplot2”, which is a graphing package

> install.packages("ggplot2")

Installing package into ‘/home/whpang/R_libs’
(as ‘lib’ is unspecified)…….

> library(ggplot2)