Adding custom global and system packages

You can install custom global and system packages to use with R Studio.

Use the following command to see the library locations for package types: > .libPaths()

This command returns the following locations:
[1] "/home/wsuser/R/library/24.1"                  "/home/wsuser/R/library"
[3] "/cc-home/_global_/R/24.1"                     "/cc-home/_global_/R"
[5] "/opt/conda/envs/R-RT24.1/lib/R/extra-library" "/opt/ibm/spark/R/lib"
[7] "/opt/conda/envs/R-RT24.1/lib/R/site-library"  "/opt/conda/envs/R-RT24.1/lib/R/library"
[9] "/opt/not-FIPS-compliant/R/library"

Global R packages

To install global R packages to the /cc-home/_global_/R folder by using the following code:
install.packages("prophet", lib="/cc-home/_global_/R",Sys.getenv("RUNTIME_TRAIN"),sep="/")

Additionaly, you can select the /cc-home/_global_/R folder as the default installation location for all users of RStudio. After you install all global R packages to this location, RStudio users can load packages from this location to use in their RStudio sessions.

System R packages

System R packages are pre-installed to the /opt/conda/envs/R-RT24.1/lib/R/site-library and the /opt/conda/envs/R-RT24.1/lib/R/library folders.

To override system R packages, install global packages.