vi ${HOME}/.Renviron
The content of this file points to the directory of your personal libraries, e.g.:
R_LIBS=${HOME}/R/lib
- create the directory, which was specified in .Renviron:
mkdir -p ${HOME}/R/lib
- start R and install packages:
install.packages('sp')