R for the HPCC
- Start an RStudio session from OnDemand
- Access the command line of the node your process is running on
through the RStudio terminal or SSH into the host OnDemand provides
you.
- The
.libPaths() function shows you where R looks for
and installs packages
- Use the
.Renviron file to set environment variables
you’d like to use for your project
- Add functions and set options in the
.Rprofile file to
customize your R session
- Start R from your project directory and use relative paths
- Setup code you want to parallelize as “mapping” a function over an
array
- Setup a
future backend to distribute each of these
function applications over cores, nodes, or both
- Use the
batchtools_slurm backend to have
future submit SLURM jobs for you
- Use a
future adapter to link your code to the
backend
- Use
module spider R/<version> to learn how to
load a version of R on the HPCC
- Run
R from the command line to start an interactive R
console
- Use the
--vanilla option to ignore extra configuration
files
- Run
Rscript to run an R script
- Use
commandArgs to parse command line arguments in an R
script
- Use
pdf() to capture plotting into a PDF file
- A SLURM script requests resources
- Generally, the only code you need in a SLURM script is loading the R
module, changing to the right directory and running your R code with
Rscript
- Check the status of your jobs with
squeue --me