I'm trying to generate a report with a number of plots (the result of applying the same analysis to a list of data.frames). The pander
package makes this pretty easy:
myReport <- Pandoc$new("Tyler", "test")
myReport$add.paragraph("# First section")
myReport$add(plot(1:10))
myReport$add.paragraph("# Second section")
myReport$add(plot(sin(seq(1, 2* pi, length = 20))
myReport$export()
This generates a nice pdf with all the plots. However, I can't figure out how to control the formatting in pandoc. For example, I don't want a table of contents, I want to control (reduce) the size of the images, and have them placed in-line, not floated. How do I set this in pander, or pass the appropriate arguments to Pandoc?
If this isn't possible, is there a better package for this? I know knitr
provides this kind of control, but I need to generate the source markdown from R -- I don't think knitr
does that. That is, knitr converts Rmd -> md -> PDF, but you still need to write the Rmd file by hand. I need to generate the Rmd (or just md) from R code.