People use the R language every day to create the elements of reports: tables, charts, analyses, and forecasts. But assembling all of that information into a print-ready document laid out with text can a hassle. You can cut-and-paste all of the elements into Word, but then what do you do when the data file gets updated at the last minute? (Answer: you have to re-run all the R code and go through the whole cut-and-paste process again. What a pain.) An alternative is to use Sweave, but that requires having a working TeX installation, and learning how to use LaTeX.
Now there's an easier-way: Yihui Xie's knitr package. It's similar to Sweave in that it automates the process of combining text with images, data and code generated by R, but it's easier to learn and use because you can structure the document with MarkDown instead of LaTeX (though you can still use LaTeX if you want).
RStudio has great knitr support and the ability to publish generated documents to the cloud for sharing. Take a look at the RStudio RPubs site (and also here) for some stunning examples of documents created with knitr, like the report on integrating R and Google visualizations excerpted below.
For a primer on getting started with knitr and Markdown, see the tutorial from Jeromy Anglim linked below.
Jeromy Anglim's Blog: Psychology and Statistics: Getting Started with R Markdown, knitr, and Rstudio 0.96
Thanks for the promotion, David.
Just a very minor clarification: "[...] with Markdown _besides_ LaTeX" might be a better description :)
Posted by: Yihui | August 21, 2012 at 17:32
I was actually looking for something that will integrate Google graphics and visualizations.Thanks for the links!
Posted by: James | August 22, 2012 at 08:51
Thanks for a terrific blog post to further highlight Yihui's innovative package.
Posted by: Tyler Rinker | August 22, 2012 at 15:45
Good point Yihui, thanks. I updated the post to make it clearer that you can also use LaTeX with knitr.
Posted by: David Smith | August 22, 2012 at 15:49
Very interesting. Thanks David for links to the package. And great job Yihui!
Posted by: Mohamed Amr Elgeneidy | August 23, 2012 at 09:18