...
Table of Contents | ||
---|---|---|
|
...
Use Case
Info |
---|
Consider the following use cases:
In both cases we can setup an R library within a shared location, such as a project folder, which all users can access, and thus use the same set of packages. |
...
General Process
Info |
---|
The general process for this is:
Every time this is to be used:
|
...
Example
Code Block |
---|
# Create R Library folder: [salexan5@mblog2 ~]$ cd /project/arcc/software/ [salexan5@mblog2 software]$ mkdir -p r_library/r_workshop [salexan5@mblog2 r_library]$ cd r_workshop/ [salexan5@mblog2 r_workshop]$ pwd /project/arcc/software/r_library/r_workshop # Load and Start R [salexan5@mblog2 ~]$ module load gcc/13.2.0 r/4.4.0 [salexan5@mblog2 ~]$ R # Check current library paths: > .libPaths() [1] "/cluster/medbow/home/salexan5/R/x86_64-pc-linux-gnu-library/4.4" [2] "/apps/u/spack/gcc/13.2.0/r/4.4.0-pvzi4gp/rlib/R/library" |
...
Current Available R Packages
Code Block |
---|
> write.table(installed.packages()[,c(1,2,3:4)]) "Package" "LibPath" "Version" "Priority" "class" "class" "/cluster/medbow/home/salexan5/R/x86_64-pc-linux-gnu-library/4.4" "7.3-22" "recommended" ... "XML" "XML" "/cluster/medbow/home/salexan5/R/x86_64-pc-linux-gnu-library/4.4" "3.99-0.17" NA "base" "base" "/apps/u/spack/gcc/13.2.0/r/4.4.0-pvzi4gp/rlib/R/library" "4.4.0" "base" ... "utils" "utils" "/apps/u/spack/gcc/13.2.0/r/4.4.0-pvzi4gp/rlib/R/library" "4.4.0" "base" |
Info |
---|
Note: We can current see packages installed:
|
...
Update the Library Path
Info |
---|
Update the library paths to point to my newly created library folder, and the base packages. |
Code Block |
---|
> .libPaths(c('/project/arcc/software/r_library/r_workshop', '/apps/u/spack/gcc/12.2.0/r/4.4.0-7i7afpk/rlib/R/library')) > write.table(installed.packages()[,c(1,2,3:4)]) "Package" "LibPath" "Version" "Priority" "base" "base" "/apps/u/spack/gcc/13.2.0/r/4.4.0-pvzi4gp/rlib/R/library" "4.4.0" "base" ... "utils" "utils" "/apps/u/spack/gcc/13.2.0/r/4.4.0-pvzi4gp/rlib/R/library" "4.4.0" "base" |
...