Presenting Data Analysis, Slidify, R Studio Presenter
Slidify has a demo wherein Ramnath Vaidyanathan downloads Slidfy, from Github, installs it into R Studio, creates a slide presentation, adds a motion graph, and shares it with the world in less than 5 minutes!
5 Minutes Intro to Slidify
In RStudio console:
library(devtools)
install_github('slidify', 'ramnathv')
install_github('slidifyLibraries', 'ramnathv')
library(slidify)
author('slidifyDemo')
Yaml Header and Slide markup
Slidify opens up an index.Rmd file. Fill out fields for Title, Subtitle, Author, and Job. Now, you are ready to add and edit your slides. The sample text is as follows:
## Read-And-Delete
1. Edit YAML front matter
2. Write using R Markdown
3. Use an empty line followed by three dashes to separate slides!
— .class #id
## Slide 2
where the ## prefixed line signifies a new slide. Edit Slide 2 above as follows:
## Slide 1
Animated List
> 1. Point 1
> 2. Point 2
> 3. Point 3
—
It appears > signifies a bullet point and — signifies the end of the slide content.
Add another slide for a motion chart we will embed:
## Motion Chart
We are halfway done!
Now, this is the awesome part. We can just inline r code into the index.Rmd within the ## Motion Chart
## Motion Chart
```{r echo=F, results = 'asis', message=F}
suppressPackageStartupMessages(library(googleVis))
M1 = gvisMotionChart(Fruits, idvar = 'Fruit', timevar = "Year")
print(M1, tag = 'chart')
```
This assumes you have googleVis installed… if not:
install.packages(“googleVis”)
Let the dataset change your mindset
– Hans Rosling
Share Slides with the World
Now, you can hit Knit in the menu bar and see your slides render. Take a few seconds to play around with the Motion Chart; it’s the same kind that you see in the Hans Rosling video on stats!!!
Now, we are ready to give the world access to your new slides. Let’s put them on GitHub. Add the following to the top of your index.Rmd:
github:
user: chadsalinas
repo: slidifyDemo
The entire Yaml header should look something like this:
—
title : Slidify Demo
subtitle : HTML Slides from R Markdown
author : Chad Salinas
job : Data Scientist
framework : io2012 # {io2012, html5slides, shower, dzslides, …}
highlighter : highlight.js # {highlight.js, prettify, highlight}
hitheme : tomorrow #
widgets : [] # {mathjax, quiz, bootstrap}
mode : selfcontained # {standalone, draft}
knit : slidify::knit2slides
github:
user: chadsalinas
repo: slidifyDemo
—
Go ahead and Knit again.
Open up and login to GitHub.
Create a new repo. I named mine ‘slidifyDemo’, same as in Yaml header, and made it public.
Go to the R Studio console and enter(with your own github username!):
publish(‘chadsalinas’, ‘slidifyDemo’)
Currently, GitHub is having issues, so you can also just share on rPubs.
Re-edit the Yaml header to delete the GitHub info and change the mode to standalone. When you are finished the header should look something like this:
—
title : Slidify Demo
subtitle : HTML Slides from R Markdown
author : Chad Salinas
job : Data Scientist
framework : io2012 # {io2012, html5slides, shower, dzslides, …}
highlighter : highlight.js # {highlight.js, prettify, highlight}
hitheme : tomorrow #
widgets : [] # {mathjax, quiz, bootstrap}
mode : standalone
—
Knit again and publish to rPubs.
So, in less than 5 minutes you can create HTML Slides with a Motion Chart to share with the world!
Sorry, the comment form is closed at this time.