The directories in R where the packages are stored are called the libraries. The terms package and library are sometimes used synonymously and there has been discussion amongst the community to resolve this.
https://www.r-bloggers.com/2013/01/packages-v-libraries-in-r/
[salexan5@blog2 r]$ cat README.ARCC We've created an R related workshop specific module file that loads the various additional modules (including openmpi/hdf5). Use by calling from the command-line: []$ module use /project/biocompworkshop/software/modules []$ module load r/4.4.0-biocomp # If using RStudio []$ module load rstudio/2023.9.0 To use the R library containing the various R packages you will need to call the following from the R Console (within RStudio) and/or at the top of your R scripts: > .libPaths(c('/project/biocompworkshop/software/r/libraries/4.4.0', '/apps/u/spack/gcc/12.2.0/r/4.4.0-7i7afpk/rlib/R/library')) This will set the library path to look within the folder: /project/biocompworkshop/software/r/libraries/4.4.0 > .libPaths() [1] "/pfs/tc1/project/biocompworkshop/software/r/libraries/4.4.0" "/apps/u/spack/gcc/12.2.0/r/4.4.0-7i7afpk/rlib/R/library" Script Example: test_libraries.R .libPaths(c('/project/biocompworkshop/software/r/libraries/4.4.0', '/apps/u/spack/gcc/12.2.0/r/4.4.0-7i7afpk/rlib/R/library')) library(Seurat) []$ Rscript test_libraries.R Loading required package: SeuratObject Loading required package: sp Attaching package: ‘SeuratObject’ The following objects are masked from ‘package:base’: intersect, t We are not able to install the following R package, due to failure with its dependencies: COMUNET (SDMTools / adehabitat) Related Articles: https://www.accelebrate.com/library/how-to-articles/r-rstudio-library