Interactive reports in R with knitr and RStudio

Last Saturday I met the guys from RStudio at the R in Finance conference in Chicago. I was curious to find out what RStudio could offer. In the past I have used mostly Emacs + ESS for editing R files. Well, and what a surprise it was. JJ, Joe and Josh showed me a preview of version 0.96 of their software, which adds a close integration of Sweave and knitr to RStudio, helping to create dynamic web reports with the new R Markdown and R HTML formats more easily.



You probably have come across Sweave in the past, but knitr is a fairly new package by Yihui Xie that brings literate programming to a new level. In particular the markdown approach allows me to create web content really quickly, without worrying to much about layout and R formatting. I begin to wonder if PDF and paper will be replaced by tablets and HTML5 in the future.

Here is a simple example. The knitr source code is available on Github.


For attribution, please cite this work as:

Markus Gesmann (May 15, 2012) Interactive reports in R with knitr and RStudio. Retrieved from

BibTeX citation:

@misc{ 2012-interactive-reports-in-r-with-knitr-and-rstudio,
 author = { Markus Gesmann },
 title = { Interactive reports in R with knitr and RStudio },
 url = { },
 year = { 2012 }
 updated = { May 15, 2012 }