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

xaringan Extras

xaringanExtra

Garrick Aden-Buie & Silvia Canelón

Professional, Polished, Presentable

1

That little bit ✨ extra

Using xaringan or rmarkdown

  1. Presenter notes
  2. Separate code chunks and their output

Using xaringanExtra

2

Presenter
Notes

3
---
## Popular Cultural References to Lemurs
1. Madagascar, the movie
4
---
## Popular Cultural References to Lemurs
1. Madagascar, the movie
???
Popular cultural references to lemurs include the Disney movie Madagascar. Really, it's all anyone knows about lemurs.
5
  1. Madagascar, the movie

Press P to toggle presenter mode

6

Popular cultural references to lemurs include the Disney movie Madagascar. Really, it's all anyone knows about lemurs.

Presenter Mode Tips

  • The notes don't have to be just for you!

  • If they are for you...

7

The notes in presenter mode aren't just to remind you of your script, they can also be very helpful to others who find your slides online!

How can you view the presenter notes and share your screen at the same time?

Presenter Mode Tips

  • The notes don't have to be just for you!

  • If they are for you...

Presenting in video

  1. Present from the private browser window without moon reader RStudio Viewer Popout Button

  2. Clone the slides into a new window with C

  3. Pick the full browser or the cloned window to share

  4. Press P in the other window

8

The notes in presenter mode aren't just to remind you of your script, they can also be very helpful to others who find your slides online!

How can you view the presenter notes and share your screen at the same time?

Don't try to present from inside RStudio. Instead, use a private browser window, either from the slides shared online or using the knit button.

Clone the slides into a new window and then choose either the small window or the full browser to share. If you want people to only see the slides, share the cloned window. If you want to share browser tabs, use the full browser. Press

9

Code + Plots

The greatest hard thing about xaringan.

10
library(dplyr)
library(ggplot2)
lemurs <- readRDS("lemurs.rds")
lemurs %>%
filter(
common_name == "Ring-Tailed Lemur",
between(age_at_wt_y, 1, 5)
) %>%
ggplot() +
aes(x = age_at_wt_y, y = weight) +
geom_point() +
labs(
x = "Age at Weight",
y = "Weight (g)",
title = "Weight Gain of Young Ring-Tailed Lemurs"
)

11
library(dplyr)
library(ggplot2)
lemurs <- readRDS("lemurs.rds")
lemurs %>%
filter(
common_name == "Ring-Tailed Lemur",
between(age_at_wt_y, 1, 5)
) %>%
ggplot() +
aes(x = age_at_wt_y, y = weight) +
geom_point() +
labs(
x = "Age at Weight",
y = "Weight (g)",
title = "Weight Gain of Young Ring-Tailed Lemurs"
)

How can we
show the code
and the plot
separately?

12

Two Little Things to Control Output

```{r lemur-weight}
# any R code ...
```
13

Two Little Things to Control Output

```{r lemur-weight, eval=FALSE}
# any R code ...
```
14

Two Little Things to Control Output

```{r lemur-weight, eval=FALSE}
# any R code ...
```
---
```{r ref.label="lemur-weight", echo=FALSE}
```
15

Two Little Things to Control Output

```{r lemur-weight}
# plotting R code ...
```
16

Two Little Things to Control Output

```{r lemur-weight}
# plotting R code ...
```
![](slide_files/figure-html/lemur-weight-1.png)
17

Two Little Things to Control Output

```{r lemur-weight, fig.show="hide"}
# plotting R code ...
```
![](`r knitr::fig_chunk("lemur-weight", "png")`)
18

Two Little Things to Control Output

```{r lemur-weight, fig.show="hide"}
# plotting R code ...
```
---
![](`r knitr::fig_chunk("lemur-weight", "png")`)
19

Two Little Things to Control Output

```{r lemur-weight, fig.show="hide"}
# plotting R code ...
```
---
background-image: url(`r knitr::fig_chunk("lemur-weight", "png")`)
background-size: cover
20

Two Little Things to Control Output

lemurs %>%
filter(
common_name == "Ring-Tailed Lemur",
between(age_at_wt_y, 1, 5)
) %>%
ggplot() +
aes(x = age_at_wt_y, y = weight) +
geom_point() +
labs(
x = "Age at Weight",
y = "Weight (g)",
title = "Weight Gain of Young Ring-Tailed Lemurs"
)

21

xaringanExtra

22

How to use xaringanExtra?

library(remotes)
install_github("gadenbuie/xaringanExtra")
29

How to use xaringanExtra?

library(remotes)
install_github("gadenbuie/xaringanExtra")
```{r xaringanExtra, echo=FALSE}
library(xaringanExtra)
use_xaringan_extra(
c("tile_view", "panelset", "share_again", "editable")
)
use_scribble(
pen_color = "#d33f49",
pen_size = 4,
palette = c("#d33f49", "#466683", "#338d70", "#c0af3f", "#ff6300")
)
```
30

How to use panelsets

.panelset[
]
31

How to use panelsets

.panelset[
.panel[
]
]
32

How to use panelsets

.panelset[
.panel[
This content will show up in panel 1!
]
]
33

How to use panelsets

.panelset[
.panel[.panel-name[First panel]
This content will show up in panel 1!
]
]
34

How to use panelsets

.panelset[
.panel[.panel-name[First panel]
This content will show up in panel 1!
]
.panel[.panel-name[Second panel]
This content will show up in the **second panel**!
]
]
35

How to use panelsets

This content will show up in panel 1!

This content will show up in the second panel!

36

How to use panelsets

```{r lemur-weight}
lemurs %>%
filter(
common_name == "Ring-Tailed Lemur",
between(age_at_wt_y, 1, 5)
) %>%
ggplot() +
aes(x = age_at_wt_y, y = weight) +
geom_point() +
labs(
x = "Age at Weight",
y = "Weight (g)",
title = "Weight Gain of Young Ring-Tailed Lemurs"
)
```
37

How to use panelsets

.panelset[
```{r lemur-weight}
lemurs %>%
filter(
common_name == "Ring-Tailed Lemur",
between(age_at_wt_y, 1, 5)
) %>%
ggplot() +
aes(x = age_at_wt_y, y = weight) +
geom_point() +
labs(
x = "Age at Weight",
y = "Weight (g)",
title = "Weight Gain of Young Ring-Tailed Lemurs"
)
```
]
38

How to use panelsets

.panelset[
```{r lemur-weight, panelset = TRUE}
lemurs %>%
filter(
common_name == "Ring-Tailed Lemur",
between(age_at_wt_y, 1, 5)
) %>%
ggplot() +
aes(x = age_at_wt_y, y = weight) +
geom_point() +
labs(
x = "Age at Weight",
y = "Weight (g)",
title = "Weight Gain of Young Ring-Tailed Lemurs"
)
```
]
39

How to use panelsets

lemurs %>%
filter(
common_name == "Ring-Tailed Lemur",
between(age_at_wt_y, 1, 5)
) %>%
ggplot() +
aes(x = age_at_wt_y, y = weight) +
geom_point() +
labs(
x = "Age at Weight",
y = "Weight (g)",
title = "Weight Gain of Young Ring-Tailed Lemurs"
)

40

How to use panelsets

Activity Time

Practice controlling code output and using panelsets.

41

That little bit ✨ extra

Using xaringan or rmarkdown

  1. Presenter notes
  2. Separate code chunks and their output

Using xaringanExtra

2
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
sToggle scribble toolbox
Esc Back to slideshow