If you can’t install packages (permission issues), you first need to specify a writeable directory to install the packages into.
Follow the steps below:
# Go to your home directory setwd("~") # Create a directory where to store the packages dir.create("R_packages") # Add directory location to the library path .libPaths("~/R_packages/")