My report

data(mtcars)

This example shows how to generate chunk labels dynamically with the brew syntax. It was motivated by the SO question: http://stackoverflow.com/q/12095113/559676

library(knitr)
src = NULL
pat_brew()  # use brew syntax first

for (cur.cyl in unique(mtcars$cyl)) {
  src = c(src, knit(text = readLines('041-label-i-child.tpl')))
}

# continue with markdown syntax and hooks
pat_md()
render_markdown()
# knit the generated R markdown source
out = knit(text = src)

Generate report for each level of cylinder variable

cat(out, sep = '\n')


Try the parsermd package in your browser

Any scripts or data that you put into this service are public.

parsermd documentation built on May 20, 2021, 5:08 p.m.