R
Installed versions
Resource | Version |
---|---|
Dardel/cpe23.12 | 4.4.1, 4.1.2 |
General information
Instructions for using R at PDC
R is a programming language and software environment for statistical computing and graphics supported by the R Foundation for Statistical Computing. The R language is widely used among statisticians and data miners for developing statistical software and data analysis. Polls, surveys of data miners, and studies of scholarly literature databases show that R's popularity has increased substantially in recent years More information can be found at https://cran.r-project.org/
R Packages
List Packages
To see a list of installed packages, please type
> installed.packages()
How to install local packages
As many packages interfere with each other it is often a good idea to
install them locally in your userspace instead.
By default, installations of R at PDC automatically sets userpath
for user installed packages to ~/.R/
$ module add R
$ R
> .libPaths()
[1] "/cfs/klemming/home/<FIRST LETTER USERNAME>/<USERNAME>/.R/23.12/4.4.0/library"
[2] "/cfs/klemming/pdc/software/dardel/23.12/other/R/4.4.0-cpeGNU-23.12/lib64/R/library"
If you would like to change this path, you must first define an R folder for the packages
export R_LIBS_USER=<FOLDER NAME>
mkdir -p <FOLDER NAME>
> install.packages("package name")
> install.packages("package name",lib=.libPaths()[1])
Install global packages
Some packages are installed by default by support. You will not have access to install yourself any global packages unless you are a member of the support group. instructions at http://www.bu.edu/tech/support/research/software-and-programming/common-languages/r-basics/r-faq/ In general we can add new packages directly from within R, but to be globally accessible they must be installed in the global repository rather than your home catalogue.
$ module add R
$ R
> .libPaths()
[1] "/cfs/klemming/home/<FIRST LETTER USERNAME>/<USERNAME>/.R/23.12/4.4.0/library"
[2] "/cfs/klemming/pdc/software/dardel/23.12/other/R/4.4.0-cpeGNU-23.12/lib64/R/library"
> install.packages("package name",lib=.libPaths()[2])
How to use
R on Dardel does not work across nodes but using the cores available on one Dardel node should suffice for all operations. run R it using
$ module add R/4.1.2
$ salloc -A <your-project-ID> -N 1 -t 60 -p <partition> srun -n 8 R --no-save <[myscript]