Running R Jobs

Quickstart: R

Build a container with R & packages installed inside:

  1. How to build your own container
  2. Example container recipes for R
  3. Use your container in your HTC jobs

Option B

Use an existing container with a base installation of R:

  1. Choose an existing container. See OSG R containers or Rocker R containers.
  2. 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.

HTC Guides