May 02 2022

Presentation Output Format

  • File > New File > R Markdown > Presentation
  • Four built-in presentation format: ioslides, Slidy, Beamer and Powerpoint.

Header 1 starts with #

  • For documents, the basic units are often sections.
  • For presentations, the basic units are slides.
  • Use header 1 # for the main topic page.

Header 2 starts with ##

subtitle after the pipe character | after Header 2

  • Header 2 starts with `##` | subtitle after the pipe character `|` after Header 2
  • Use header 2 ## to create pages under the header 1 # topic.
  • Turn off alarm
  • Get out of bed

Slide with R Output

summary(cars)
##      speed           dist       
##  Min.   : 4.0   Min.   :  2.00  
##  1st Qu.:12.0   1st Qu.: 26.00  
##  Median :15.0   Median : 36.00  
##  Mean   :15.4   Mean   : 42.98  
##  3rd Qu.:19.0   3rd Qu.: 56.00  
##  Max.   :25.0   Max.   :120.00

Slide with Plot

plot(cars)

Use ---- to create a new slide without a header.

plot(cars)

Display Modes

  • f: enable fullscreen mode

  • w: toggle widescreen mode

  • o: enable overview mode

  • h: enable code highlight mode

  • p: show presenter notes

Add presenter notes to a slide

<div class="notes">
This is my *note*.

- It can contain markdown
- like this list
</div>

Incremental Bullets

  • You can render bullets incrementally (globally) by adding the incremental option: incremental: true
---
output:
  ioslides_presentation:
    incremental: true
---
  • If you want to render bullets incrementally (locally) for some slides but not others you can use >- instead of -.
> - Eat eggs
> - Drink coffee
  • Eat eggs
  • Drink coffee

Smaller Text

  • You can display the presentation using a wider form factor using widescreen: true
  • You can specify that smaller text be used with smaller: true.
---
output:
  ioslides_presentation:
    widescreen: true
    smaller: true
---
  • You can also enable the smaller option on a slide-by-slide basis by adding the .smaller attribute to the slide header: ## Smaller Text {.smaller}

Transition Speed

  • I use Transition Speed {.build} so the slide content is displayed incrementally.
  • You can customize the speed of slide transitions using transition option, transition: faster for example.
  • This can be “default”, “slower”, “faster”, or a numeric value with a number of seconds (e.g., 0.5)
---
output:
  ioslides_presentation:
    transition: faster
---

Background Image

  • Use attribute data-background, data-background-size, data-background-position, and data-background-repeat after the slides header
  • Example: ## Background Image {data-background=./img/cloud.png data-background-size=cover}

Code Highlighting

  • ### <b> code to be highlighted ### </b>
  • Press the h key and the rest of the code will fade away.
x <- 10
y <- x * 2
z <- 20
a <- 32

Adding a Logo

Tables

First Header  | Second Header
------------- | -------------
Content Cell  | Content Cell
Content Cell  | Content Cell
First Header Second Header
Content Cell Content Cell
Content Cell Content Cell

Center Content

You can center content on a slide by adding the .flexbox and .vcenter attributes to the slide title like ## Center Content {.flexbox .vcenter}

Horizontally Center Content

<div class="centered">
This text is centered.
</div>

This text is centered.

Two-column Layout

<div class="columns-2">
  ![I Love Marquette](./img/mu_white.png){ width=50% }

  - MATH 3570
  - COSC 3570
  - Dr. Yu is a R programming and data science expert!
  
</div>

I Love Marquette

  • MATH 3570
  • COSC 3570
  • Dr. Yu is a R programming and data science expert!

Text Color

You can color content using base color classes red, blue, green, yellow, and gray (or variations of them, e.g., red2, red3, blue2, blue3, etc.).

<div class="red2">
This text is red2
</div>

This text is red2

Publish Data Science Documents

Publish Data Science Documents - RPubs Website

  • Free and simple web publishing platform RPubs

Publish Data Science Documents - RPubs Register

Publish Data Science Documents - RPubs Step 2