Skip to content

Instantly share code, notes, and snippets.

@daskelly
Last active September 5, 2017 01:48
Show Gist options
  • Save daskelly/4f33a960504c2957b2f04e0eb2a554b2 to your computer and use it in GitHub Desktop.
Save daskelly/4f33a960504c2957b2f04e0eb2a554b2 to your computer and use it in GitHub Desktop.
Render an R markdown document on a PBS/Torque cluster
#!/bin/bash
#PBS -N name
#PBS -l nodes=1:ppn=1,mem=10gb,walltime=6:00:00
#PBS -m n
#PBS -j oe
#PBS -r n
module load R/3.3.2 gcc/4.9.2
module load pandoc/1.13.1
cd $PBS_O_WORKDIR
RMD_FILE="/path/to/file.Rmd"
Rscript -e "library(methods); rmarkdown::render('$RMD_FILE', knit_root_dir=getwd(), output_dir=getwd())"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment