Skip to content

Instantly share code, notes, and snippets.

@jananiravi
Last active August 14, 2019 22:05
Show Gist options
  • Save jananiravi/7b66546350755271c1fedd4d4c075ae8 to your computer and use it in GitHub Desktop.
Save jananiravi/7b66546350755271c1fedd4d4c075ae8 to your computer and use it in GitHub Desktop.
# knitr::purl(input_file, output_file, documentation = 2)
infile <- "your_filename.Rmd"
inpath <- "docs/"; outpath <- "scripts/"
name <- strsplit(infile, split = "\\.")[[1]][1]
knitr::purl(paste0(inpath, infile),
paste0(outpath, name,
"_rmd2r_", format(Sys.time(), "%Y%m%d"),
".R", sep = ""),
documentation = 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment