Tonight I will give a talk at the Cambridge R user group about googleVis. 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.
I used RStudio again to edit my Rmd-file and
knitr to generate the Markdown md-file output. Following this I run
pandoc on the command line to convert the md-file into a single
Et volià, here is the result:
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
Addition (2 June 2012)Oh boy, knitr and Markdown are hitting a nail. With slidify by Ramnath Vaidyanathan another project sprung up to ease the creation of web presentations.
John D. Cook gave a great talk about 'Why and how people use R'. The talk resonated with me and highlighted why R is such a great tool for end user computing. A topic which has become increasingly important in the European insurance industry.
John's main point on why people use R is that R gets the job done and I think he is spot on. Of course that's the trouble with R sometimes as well, or to quote Bo again:
"The best thing about R is that it was developed by statisticians.
"The worst thing about R is that it was developed by statisticians."
Bo Cowgill, Google
|Screen shot of RStudio with a knitr file (*.Rmd) in the top left window. |
Notice also the integrated knitr button.
Here is a simple example. The knitr source code is available on Github.
Waterfall charts are sometimes quite helpful to illustrate the various moving parts in financial data, in particular when I have positive and negative values like a profit and loss statement (P&L). However, they can be a bit of a pain to produce in Excel. Not so in R, thanks to the waterfall package by James Howard. In combination with the latticeExtra package it is nearly a one-liner to produce a good looking waterfall chart that mimics the look of The Economist:
|Example of a waterfall chart in R|
Of course you can create a waterfall chart also with
library(latticeExtra) library(waterfall) data(rasiel) # Example data of the waterfall package rasiel # label value subtotal # 1 Net Sales 150 EBIT # 2 Expenses -170 EBIT # 3 Interest 18 Net Income # 4 Gains 10 Net Income # 5 Taxes -2 Net Income asTheEconomist( waterfallchart(value ~ label, data=rasiel, groups=subtotal, main="P&L") )
ggplot2, the Learning R blog has a post on this topic.
The next Cologne R user group meeting is scheduled for 6 July 2012. All details are available on the new KölnRUG Meetup site. Please sign up if you would like to come along, and notice that there is also pub poll for the after "work" drinks. Notes from the first Cologne R user group meeting are available here.