% Video in html % L [Collado-Torres](http://www.biostat.jhsph.edu/~lcollado/#.UMAMRJPjl18) % Dec 5, 2012 # Pipeline ## Three steps One way is to write the presentation in R markdown (Rmd) using [Rstudio](http://www.rstudio.com/) Then you use [knitr](http://yihui.name/knitr/) to export it to markdown. And finally use [pandoc](http://johnmacfarlane.net/pandoc/) to create the html slides. More [here](http://yihui.name/en/2012/05/how-to-make-html5-slides-with-knitr/) and [here](http://fellgernon.tumblr.com/post/35587597245/introduction-to-r-and-biostatistics-2012-version#.UMANV5Pjl18) # Video ## Youtube This is just an example of how to include youtube videos on an html presentation. Basically in the Rmd file you add the video using _div_ and _iframe_ html tags directly: ```r
``` ## Result
# Extra ## Rcode Well, _knitr_ is really made to include R code ```r summary(cars) ``` ``` ## speed dist ## Min. : 4.0 Min. : 2 ## 1st Qu.:12.0 1st Qu.: 26 ## Median :15.0 Median : 36 ## Mean :15.4 Mean : 43 ## 3rd Qu.:19.0 3rd Qu.: 56 ## Max. :25.0 Max. :120 ``` ## Plots ```r plot(cars, col = "blue") ``` plot of chunk unnamed-chunk-3 ## Math And some equations $$ f_Z(z) = \frac{1}{\sqrt{2 \pi}} \exp \left( - \frac{z^2}{2} \right) $$ # Steps ## Briefly * Write the Rmd file in Rstudio * Click on the _Knit HTML_ button * Run the following command ```r pandoc -s -S --webtex -t dzslides filename.md -o outputName.html ```