Video in html

L Collado-Torres

Dec 5, 2012

Pipeline

Three steps

One way is to write the presentation in R markdown (Rmd) using Rstudio

Then you use knitr to export it to markdown.

And finally use pandoc to create the html slides.

More here and here

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:

<div align="center">
<iframe width="560" height="315"
src="http://www.youtube.com/embed/9bZkp7q19f0"
frameborder="0" allowfullscreen>
    </iframe></div>

Result

Extra

Rcode

Well, knitr is really made to include R code

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

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

pandoc -s -S --webtex -t dzslides
filename.md -o outputName.html