On Ubuntu, the recommended wayrecommended way of changing the default library path for a user, is to set the R_LIBS_USER
variable in the ~/.Renviron
file. [1]
touch ~/.Renviron
echo "R_LIBS_USER=/absolute/custom/path"path/in/absolute/form" >> ~/.Renviron
[1] https://cran.r-project.org/bin/linux/ubuntu/README.html#pathways-to-r-packages