Running R Jobs
Quickstart: R
Option A (recommended)
Build a container with R & packages installed inside:
Option B
Use an existing container with a base installation of R:
- Choose an existing container. See OSG R containers or Rocker R containers.
- Use the container in your HTC jobs
More information
No CHTC machine has R pre-installed, so you must configure a portable copy of R to work on the HTC system. Using a container as described above is the easiest way to accomplish this.
Executable
When using a container, you can use a .R
script as the submit file executable
, provided that the first line (the “shebang”) in the .R
file is
#!/usr/bin/env Rscript
with the rest of the file containing the commands that you want to run using R.
Alternatively, you can use a bash .sh
script as the submit file executable
, and in that file you can use the Rscript
command:
#!/bin/bash
Rscript my-script.R
In this case, remember to include your .R
file in the transfer_input_files
line of your submit file.