+ - 0:00:00
Notes for current slide
Notes for next slide

xaringan

  • xaringan package to be a Presentation Ninja ðŸĪš
3/22

xaringan

  • xaringan package to be a Presentation Ninja ðŸĪš

  • "for creating slideshows with remark.js through R Markdown"

3/22

xaringan

  • xaringan package to be a Presentation Ninja ðŸĪš

  • "for creating slideshows with remark.js through R Markdown"

  • Xie Yihui

3/22

Packages required:

library(palmerpenguins) # to access penguin data
library(xaringan)
library(xaringanthemer)
library(xaringanExtra)
4/22

File âŸķ New File âŸķ R Markdown

5/22

Template → Ninja Presentation

6/22

Save this Rmd file

7/22

Addins → Inifinite Moon Reader

8/22

Addins → Inifinite Moon Reader

xaringan output

8/22

Addins → Inifinite Moon Reader

xaringan slide → browser

9/22

Addins → Inifinite Moon Reader

xaringan slide → browser

  • We need to click Inifinite Moon Reader only to start the slideshow. To see the changes made in the slides just save the document ctrl + s
9/22

Using xaringan how to:

10/22

Using xaringan how to:

  1. create a new slide
10/22

Using xaringan how to:

  1. create a new slide

  2. hide an existing slide

10/22

Using xaringan how to:

  1. create a new slide

  2. hide an existing slide

  3. heading, subheadings, points and normal text

10/22

Using xaringan how to:

  1. create a new slide

  2. hide an existing slide

  3. heading, subheadings, points and normal text

  4. include images

10/22

Using xaringan how to:

  1. create a new slide

  2. hide an existing slide

  3. heading, subheadings, points and normal text

  4. include images

    • as background
10/22

Using xaringan how to:

  1. create a new slide

  2. hide an existing slide

  3. heading, subheadings, points and normal text

  4. include images

    • as background
    • as part of slide
10/22

Using xaringan how to:

  1. create a new slide

  2. hide an existing slide

  3. heading, subheadings, points and normal text

  4. include images

    • as background
    • as part of slide
  5. make plots

10/22

Using xaringan how to:

  1. create a new slide

  2. hide an existing slide

  3. heading, subheadings, points and normal text

  4. include images

    • as background
    • as part of slide
  5. make plots

  6. include tables

10/22

Using xaringan how to:

  1. create a new slide

  2. hide an existing slide

  3. heading, subheadings, points and normal text

  4. include images

    • as background
    • as part of slide
  5. make plots

  6. include tables

  7. in-text R output

10/22

Using xaringan how to:

  1. create a new slide

  2. hide an existing slide

  3. heading, subheadings, points and normal text

  4. include images

    • as background
    • as part of slide
  5. make plots

  6. include tables

  7. in-text R output

  8. create columns

10/22
  1. Use --- to create a new slide
11/22
  1. Use --- to create a new slide

  2. exclude:true To hide an existing slide

11/22
  1. Use --- to create a new slide

  2. exclude:true To hide an existing slide

  3. Slide text sizes:

11/22
  1. Use --- to create a new slide

  2. exclude:true To hide an existing slide

  3. Slide text sizes:

    • # for main heading
11/22
  1. Use --- to create a new slide

  2. exclude:true To hide an existing slide

  3. Slide text sizes:

    • # for main heading

    • ## for sub-heading

11/22
  1. Use --- to create a new slide

  2. exclude:true To hide an existing slide

  3. Slide text sizes:

    • # for main heading

    • ## for sub-heading

    • #### for sub-sub-heading

11/22
  1. Use --- to create a new slide

  2. exclude:true To hide an existing slide

  3. Slide text sizes:

    • # for main heading

    • ## for sub-heading

    • #### for sub-sub-heading

    • indented * for sub-point1
    • indented * for sub-point2
    • indented * for sub-point3
11/22
  1. Use --- to create a new slide

  2. exclude:true To hide an existing slide

  3. Slide text sizes:

    • # for main heading

    • ## for sub-heading

    • #### for sub-sub-heading

    • indented * for sub-point1
    • indented * for sub-point2
    • indented * for sub-point3
  • - for normal text size
11/22

To include images using:

CSS background option:

12/22

To include images using:

CSS background option:

  • background-image: url("path of the image") = path of the image
12/22

To include images using:

CSS background option:

  • background-image: url("path of the image") = path of the image

  • background-size: contain, cover, 50%, 70% = size of the image

12/22

To include images using:

CSS background option:

  • background-image: url("path of the image") = path of the image

  • background-size: contain, cover, 50%, 70% = size of the image

  • background-position: left top = position of the image

12/22

To include images using:

knitr chunk option:

knitr::include_graphics("path of the image")
13/22

To include plots

library(palmerpenguins)
ggplot(penguins, aes(x = species)) +
geom_bar()
14/22

To include tables

library(kableExtra)
library(tidyverse)
penguins %>%
drop_na() %>%
head() %>%
kable()
species island bill_length_mm bill_depth_mm flipper_length_mm body_mass_g sex year
Adelie Torgersen 39.1 18.7 181 3750 male 2007
Adelie Torgersen 39.5 17.4 186 3800 female 2007
Adelie Torgersen 40.3 18.0 195 3250 female 2007
Adelie Torgersen 36.7 19.3 193 3450 female 2007
Adelie Torgersen 39.3 20.6 190 3650 male 2007
Adelie Torgersen 38.9 17.8 181 3625 female 2007
15/22

In-text R output

  • penguins data have a sample of n = 344 on total 8 variables.
16/22

In-text R output

  • penguins data have a sample of n = 344 on total 8 variables.

  • math expressions

a+b=σ−∑x22

16/22

Column division of slide

- left column

  • a

    • b
    • c

- right column

  • apple
  • boy
  • cat
17/22

Slide class

  • class can be assigned to each slide
18/22

Slide class

  • class can be assigned to each slide

  • it decides how all elements of one particular slide will look like

18/22

Slide class

  • class can be assigned to each slide

  • it decides how all elements of one particular slide will look like

  • class: center

19/22

Slide class

  • class can be assigned to each slide

  • it decides how all elements of one particular slide will look like

  • class: center, middle, inverse, right

20/22

Extend the power of xaringan:

21/22

Extend the power of xaringan:

21/22

Extend the power of xaringan:

21/22

Extend the power of xaringan:

21/22
Paused

Help

Keyboard shortcuts

↑, ←, Pg Up, k Go to previous slide
↓, →, Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
oTile View: Overview of Slides
Alt + fFit Slides to Screen
Esc Back to slideshow