Robert J. Walls
University of Massachusetts
Philosophy: Separate the content writing from the its rendering.
Uses R Markdown.
Start a new slide with a blank line followed by three dashes (---
).
---
## Title
### Bigger text
Basic text:
- Thing 1
- Thing 2
Basic text:
Column 1 | Column 2 |
---|---|
Foo | Bar |
Blah | Blah |
Bing | Bang |
Column 1 | Column 2
----------|---------
Foo | Bar
Blah | Blah
Bing | Bang
Every deck starts with YAML to specify the basics.
title : Slidify
subtitle : Presentations from R Markdown
author : Robert J. Walls
job : University of Massachusetts
framework : io2012 # {io2012, html5slides, shower, dzslides, ...}
highlighter : highlight.js # {highlight.js, prettify, highlight}
hitheme : tomorrow #
widgets : [mathjax, bootstrap] # {mathjax, quiz, bootstrap}
mode : selfcontained # {standalone, draft}
biglogo : robertsrobot.png
logo : umass.png
library(plyr)
library(ggplot2)
df <- diamonds[seq(1, 5), ]
df <- with(df, cbind(price, carat, cut, clarity))
# Make the header
header <- paste(colnames(df), collapse = " | ")
dashline <- paste(rep(c("---"), length(colnames(df))), collapse = " | ")
# Add the data
data <- aaply(df, 1, paste, collapse = " | ")
cat(header, dashline, data, sep = "\n")
price | carat | cut | clarity |
---|---|---|---|
326 | 0.23 | 5 | 2 |
326 | 0.21 | 4 | 3 |
327 | 0.23 | 2 | 5 |
334 | 0.29 | 4 | 4 |
335 | 0.31 | 2 | 2 |
Make sure to set results='asis'
.
library(ggplot2)
ggplot(diamonds, aes(carat, price)) + geom_hex()
Use echo=FALSE
to hide the code block on your slide.
Equations can be written inline, \(\frac{1}{n} \sum_{i=i}^{n} x_{i}\), such as this. Or if you want to get fancy:
\[ H(X)=-\sum_{i}{P(x_i) log_b P(x_i)} \]
$\frac{1}{n} \sum_{i=i}^{n} x_{i}$
$$ H(X)=-\sum_{i}{P(x_i) log_b P(x_i)} $$
In the starting YAML, make sure to include
widgets : [mathjax]
Use fenced code blocks to render code with syntax highlighting.
```python ...CODE! ```
def hello():
'''
Such a boring function
'''
print 'hi!'
if __name__ == '__main__':
hello()
You have to use Hadley's devtools
package to download and install Slidify from Github.
library(devtools)
install_github('slidify', 'ramnathv')
install_github('slidifyLibraries', 'ramnathv')
It is simple to create a new presentation.
library(slidify)
#Create a new presentation called 'mydeck'
author('mydeck')
Slidify does the setup work for you (including creating the github repo).
You just need to edit the index.Rmd
file!
Sharing your handiwork is easy.
# Generate the Deck
slidify('index.Rmd')
# Publish it to github
publish(user='rjwalls', repo='SlidifyTest', host='github')
Puts the presentation at http://rjwalls.github.com/SlidifyTest. Note that you need to setup your Github SSH keys.
Can also use Rpubs or Dropbox.
title : Slidify
subtitle : Presentations from R Markdown
author : Robert J. Walls
job : University of Massachusetts
framework : io2012 # {io2012, html5slides, shower, dzslides, ...}
highlighter : highlight.js # {highlight.js, prettify, highlight}
hitheme : tomorrow #
widgets : [mathjax, bootstrap] # {mathjax, quiz, bootstrap}
mode : selfcontained # {standalone, draft}
biglogo : robertsrobot.png
logo : umass.png
The default slide framework is io2012
from Google's 2012 I/O developer conference.
Adds some nice presenter features
Append ?presentme=true
to the presentation url to get the presenter view. Use ?presentme=false
to disable presenter mode.
Slide level metadata are specified as key:value pairs. Commonly specified metadata like id, class and layout can also be identified by prefixing with punctuation marks #, . and & respectively.
--- &vcenter
--- .segue .dark
--- .segue .quote .dark, bg:url(allyourbase.jpg)
--- &vcenter
Lime cat is important.
--- .segue .dark
--- .segue .quote .dark, bg:url(allyourbase.jpg)
All your base are belong to us.
Quick and easy way to create presentations, but it's not quite ready to replace Keynote.
Lacking: