Skip to content

Instantly share code, notes, and snippets.

@wckdouglas
Created January 21, 2016 23:52
Show Gist options
  • Save wckdouglas/64160636e3aed3971437 to your computer and use it in GitHub Desktop.
Save wckdouglas/64160636e3aed3971437 to your computer and use it in GitHub Desktop.
#!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
if (length(args)<1) {
stop("A Rmarkdown file has to be specified\n", call.=FALSE)
} else if (length(args)>0) {
# default output file
markdownFile = args[1]
for (markdownFile in args){
rmarkdown::render(markdownFile)
}
}
message('Rendered ',length(args),' files')
@wckdouglas
Copy link
Author

usage: ./renderRMD.R <1.Rmd file> <2.Rmd file> ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment