% Writing beautiful and reproducible slides quickly
% Yihui Xie
% 2012/04/30

Why

A bit R code

head(cars)
##   speed dist
## 1     4    2
## 2     4   10
## 3     7    4
## 4     7   22
## 5     8   16
## 6     9   10
cor(cars)
##        speed   dist
## speed 1.0000 0.8069
## dist  0.8069 1.0000

Graphics too

library(ggplot2)
## Error: there is no package called 'ggplot2'
qplot(speed, dist, data = cars) + geom_smooth()
## Error: could not find function "qplot"

How

For ninjas

For beamer lovers

For Powerpoint lovers

Reproducible research

It is good to include the session info, e.g. this document is produced with knitr. Here is my session info:

print(sessionInfo(), locale = FALSE)
## R version 2.15.2 (2012-10-26)
## Platform: x86_64-redhat-linux-gnu (64-bit)
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] knitr_1.2
## 
## loaded via a namespace (and not attached):
## [1] codetools_0.2-8 digest_0.6.3    evaluate_0.4.3  formatR_0.8    
## [5] stringr_0.6.2   tools_2.15.2

Misc issues

Life is short