% 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, eval=FALSE}
``` ## Result
# Extra ## Rcode Well, _knitr_ is really made to include R code ```{r } summary(cars) ``` ## Plots ```{r out.width="400px", out.height="400px", fig.width=5, fig.height=5, fig.align='center', dpi=300} plot(cars, col = "blue") ``` ## 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, eval=FALSE} pandoc -s -S --webtex -t dzslides filename.md -o outputName.html ```