Creating a slideshow presentation in R is easy!
- Install slidify.
- Edit Rmd document to create slides.
- Publish to html and web!
Kory Becker
http://www.primaryobjects.com
Creating a slideshow presentation in R is easy!
The following code installs slidify in R.
## Including the required R packages.
packages <- c('devtools', 'stringi')
if (length(setdiff(packages, rownames(installed.packages()))) > 0) {
install.packages(setdiff(packages, rownames(installed.packages())))
}
library(devtools)
install_github('ramnathv/slidify')
install_github('ramnathv/slidifyLibraries')
library(slidify)
author('Slidify')
That last command should create ~/Slidify/index.Rmd for you.
index.Rmd should be opened automatically for you.
Set the title, subtitle, and author.
---
title : Your Title Here
subtitle : Your subtitle here
author : Me
job : Cool Guy
framework : io2012
highlighter : highlight.js
hitheme : tomorrow
widgets : [bootstrap, quiz]
mode : selfcontained
knit : slidify::knit2slides
---
We're including the widgets "bootstrap, quiz" to support interactive slides.
To create a slide, include the following code per slide.
--- .class #id
## A Slide Title
This is my first slide.
Separate slides with 3 dashes.
To preview the slideshow, run the command:
slidify('index.Rmd')
Then open your folder, navigate into the presentation folder, and double-click index.html.
Any time you modify a slide, run the command again.
slidify('index.Rmd')
Then refresh the web page to see the results.
Slidify automatically creates a git repository for you.
This makes publishing easy.
What do the widgets "bootstrap, quiz" allow?
One of the widgets is named "quiz", which lets the user interact with elements on the slide.
bootstrap and quiz allow support for interactive slides, specifically Quiz-enabled slides. See http://slidify.github.io/dcmeetup/demos/interactive/
What command separates slides in a presentation?
Three symbols separate slides in a presentation, but which symbol is it?
To separate slides in a slidify Rmd presentation, use 3 dashes. You can follow this by a class name for styling.
For example:
--- .class #id
Now, you're a slidify professional!