Managing R Packages on SSCC Computers

Much of R’s utility comes from user-written packages. A basic R installation includes 30 core packages, and SSCC staff have installed some additional popular packages on SSCC computers. However, it is very common for our users to find they need additional packages for their work, and SSCC computers are configured to make this easy for you to manage.

Managing Packages

On SSCC computers, R packages are installed in three folders. On our Windows computers these are:

  • core packages:
    • “C:/Program Files/R/R-4.1.0/library”
  • SSCC managed packages:
    • “C:/Program Files/R/R-4.1.0/site-library”
  • user managed packages:
    • “U:/R/4.1.0”

On our linux computers we have:

  • user managed packages:
    • “~/R/x86_64-pc-linux-gnu-library/4.1”

The user-managed folder is where your personal packages will be installed by default. (There are numerous ways to change or temporarily override this default if you need to.)

To find your current package folders on any computer, start R and issue the command

.libPaths()

Updating and Reinstalling Packages

SSCC staff update the core R software and SSCC-managed packages about every six months.

If you need an updated package in between our regular updates, all you need to do is update or reinstall the package yourself. The updated version will be installed in your user-managed folder, and R will use the updated version in preference to the SSCC-managed version.

After each SSCC update, once you use R or RStudio for the first time, you will have a new user-managed package folder. To easily update all the R packages you have installed, just copy all your package files from your old folder to the new folder and issue the command

update.packages()

If you have a lot of packages, the actual update could take a while!

Last Revised: 08/18/2021