Using loops with knitr to produce multiple pdf reports… need a little help to get me over the hump

You don’t need to re-define the data in the .Rnw file and I think the warning is coming from the fact that you are putting the output name together with Hospital (the full vector of hospitals) rather than hosp (the loop index). Following your example, testingloops.Rnw would be \documentclass[10pt]{article} \usepackage[margin=1.15 in]{geometry} <<loaddata, echo=FALSE, message=FALSE>>= subgroup … Read more

YAML current date in rmarkdown

This is a little bit tricky, but you just need to make the date field valid in YAML by quoting the inline R expression, e.g. date: “`r format(Sys.time(), ‘%d %B, %Y’)`” Then the parsing error will be gone, and the date will be generated in the markdown output so Pandoc can use the value from … Read more