background preloader

Reportes Web R

Facebook Twitter

Interactive HTML presentation with R, googleVis, knitr, pandoc and slidy. Tonight I will give a talk at the Cambridge R user group about googleVis.

Interactive HTML presentation with R, googleVis, knitr, pandoc and slidy

Following my good experience with knitr and RStudio to create interactive reports, I thought that I should try to create the slides in the same way as well. Christopher Gandrud's recent post reminded me of deck.js, a JavaScript library for interactive html slides, which I have used in the past, but as Christopher experienced, it is currently not that straightforward to use with R and knitr. Thus, I decided to try slidy in combination with knitr and pandoc. And it worked nicely. I used RStudio again to edit my Rmd-file and knitr to generate the Markdown md-file output. Pandoc -s -S -i -t slidy --mathjax Cambridge_R_googleVis_with_knitr_and_RStudio_May_2012.md -o Cambridge_R_googleVis_with_knitr_and_RStudio_May_2012.html Et volià, here is the result: To leave a comment for the author, please follow the link and comment on his blog: mages' blog. Knitr: Elegant, flexible and fast dynamic report generation with R. Overview The knitr package was designed to be a transparent engine for dynamic report generation with R, solve some long-standing problems in Sweave, and combine features in other add-on packages into one package (knitr ≈ Sweave + cacheSweave + pgfSweave + weaver + animation::saveLatex + R2HTML::RweaveHTML + highlight::HighlightWeaveLatex + 0.2 * brew + 0.1 * SweaveListingUtils + more).

knitr: Elegant, flexible and fast dynamic report generation with R

This package is developed on GitHub; for installation instructions and FAQ’s, see README. This website serves as the full documentation of knitr, and you can find the main manual, the graphics manual and other demos / examples here. For a more organized reference, see the knitr book. Motivation One of the difficulties with extending Sweave is we have to copy a large amount of code from the utils package (the file SweaveDrivers.R has more than 700 lines of R code), and this is what the two packages mentioned above have done. Features Acknowledgements Misc. Knitr: Un paquete avanzado para la edición de informes dinámicos. El paquete knitr de Yihui Xie se ha diseñado para superar algunos problemas de Sweave y avanzar en la edición de informes dinámicos con R.

knitr: Un paquete avanzado para la edición de informes dinámicos

Una fórmula del propio autor resume el conjunto de aplicaciones incluidas en el paquete: knitr ≈ Sweave + cacheSweave + pgfSweave + weaver + R2HTML::RweaveHTML + highlight::HighlightWeaveLatex + 0.2 * brew + 0.1 * SweaveListingUtils + more Las ventajas sobre Sweave son múltiples. En primer lugar y lo más evidente es el coloreado del código, pero también la habilidad para formatear el código automáticamente.

Este paquete incluye el soporte para varios dispositivos gráficos, entre ellos el tikzDevice que traduce el gráfico a código LaTeX y, por lo tanto, escribir fórmulas en LaTeX dentro del gráfico en la misma fuente que el texto. Además, los viejos archivos .Rnw de Sweave se pueden reciclar fácilmente. Enlaces: knitr: Markdown + knitr + RStudio Uso del formato Markdown para escribir páginas web. Test. Interactive reports in R with knitr and RStudio.