Can evaluate R code chunks into HTML & PNG output (or PDF) • Helpful for generating reproducible reports A Test Report for Kumquat ======================================================== This is some code for Knitr, including [a link](https://www.kickstarter.com). A list: * One * Another thing * Last thing! ### More stuff. Lorem Ipsum. ```{r, fig.width=10, fig.height=8, echo=FALSE, message=FALSE} library(ggplot2) qplot(data = data.frame( x = runif(100), y = runif(100) ), x = x, y = y) ``` ### Another ```{r, fig.width=10, fig.height=8, echo=FALSE, message=FALSE} library(ggplot2) qplot(data = data.frame( x = runif(100), y = runif(100) ), x = x, y = y) ``` ### A Table ```{r, results='asis', echo=FALSE} library(hwriter) cat(hwrite(data.frame( x = runif(10), y = runif(10) ))) ```
for Knitr, including [a link](https://www.kickstarter.com). A list: * One * Another thing * Last thing! ### More stuff. Lorem Ipsum. ```{r, fig.width=10, fig.height=8, echo=FALSE, message=FALSE} Normal Markdown } library(ggplot2) qplot(data = data.frame( x = runif(100), y = runif(100) ), x = x, y = y) ``` knitr call } R code }
& base64 encoded images • Includes a Ruby Template Handler for rendering .Rmd Files • Includes a Mail Interceptor for attaching inline images • Includes a Chef recipe for installing R & libraries in production
= extract_images mail['X-SIG'] = 'bypass' m = mail # Need a local variable so that we don't fight with the mail object mixed_part = Mail::Part.new do content_type 'multipart/alternative' m.parts.delete_if { |p| add_part p } end mail.add_part mixed_part # Set the message content-type to be 'multipart/mixed' mail.content_type 'multipart/related' mail.header['content-type'].parameters[:boundary] = mail.body.boundary @images.each do |key, image| mail.attachments.inline[key] = image end mail end
code for Knitr, including [a link](https://www.kickstarter.com). A list: * One * Another thing * Last thing! ### More stuff. Lorem Ipsum. ```{r, fig.width=10, fig.height=8, echo=FALSE, message=FALSE} library(ggplot2) qplot(data = data.frame( x = runif(100), y = runif(100) ), x = x, y = y) ```