Skip to content

Instantly share code, notes, and snippets.

@Altons
Created January 26, 2013 17:01
Show Gist options
  • Save Altons/4643278 to your computer and use it in GitHub Desktop.
Save Altons/4643278 to your computer and use it in GitHub Desktop.
R snippets
KnitPost <- function(input, base.url = "/") {
require(knitr)
opts_knit$set(base.url = base.url)
fig.path <- paste0("figs/", sub(".Rmd$", "", basename(input)), "/")
opts_chunk$set(fig.path = fig.path)
opts_chunk$set(fig.cap = "center")
render_jekyll()
knit(input, envir = parent.frame())
}
KnitPost("2012-07-03-knitr-jekyll.Rmd")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment