R Slidify Tutorial

Quick Start to Slidify in R

Kory Becker
http://www.primaryobjects.com

Introduction

Creating a slideshow presentation in R is easy!

  1. Install slidify.
  2. Edit Rmd document to create slides.
  3. Publish to html and web!

Installing Slidify

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.

Set the Title and Author

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.

Adding a Slide

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.

Previewing

To preview the slideshow, run the command:

slidify('index.Rmd')

Then open your folder, navigate into the presentation folder, and double-click index.html.

Making Changes

Any time you modify a slide, run the command again.

slidify('index.Rmd')

Then refresh the web page to see the results.

Publishing

Quiz 1/2

What do the widgets "bootstrap, quiz" allow?

  1. Displaying a blue background for the presentation.
  2. Starting a new presentation from scratch.
  3. Including support for interactive slides.
  4. Creating a black & white presentation.

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/

Quiz 2/2

What command separates slides in a presentation?

  1. *
  2. ##
  3. ---
  4. ====

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 

Conclusion