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

clipboard
for xaringan

📋

xaringanExtra

1 / 7

Clip Code Chunks

Here's some R code in the middle of your presentation. Let your audience (or yourself) copy the code with a single click.

Hover over the chunk below to reveal the "Copy Code" button.

library(ggplot2)
ggplot(Orange) +
aes(x = age, y = circumference, colour = Tree) +
geom_point() +
geom_line() +
guides(colour = FALSE) +
theme_bw()

📱 It even works for slides viewed on phones!

2 / 7

Use clipboard

To add the clipboard button to all of the code chunks in your slides, add this chunk to your slides

```{r xaringanExtra-clipboard, echo=FALSE}
xaringanExtra::use_clipboard()
```

Practice copying and pasting the above chunk into your slide code here.

3 / 7

Customize Button Text

You can customize the button_text, or the text shown on success or error.

```{r xaringanExtra-clipboard, echo=FALSE}
xaringanExtra::use_clipboard(
button_text = "Haga clic para copiar",
success_text = "Copiado",
error_text = "Pulse Ctrl + C para copiar"
)
```
4 / 7

Customize Button Text

You can customize the button_text, or the text shown on success or error.

```{r xaringanExtra-clipboard, echo=FALSE}
xaringanExtra::use_clipboard(
button_text = "Haga clic para copiar",
success_text = "Copiado",
error_text = "Pulse Ctrl + C para copiar"
)
```

💡 Hint: These values accept HTML, the sky's the limit!

```{r xaringanExtra-clipboard, echo=FALSE}
htmltools::tagList(
xaringanExtra::use_clipboard(
button_text = "<i class=\"fa fa-clipboard\"></i>",
success_text = "<i class=\"fa fa-check\" style=\"color: #90BE6D\"></i>",
),
rmarkdown::html_dependency_font_awesome()
)
```

This example replaces the copy button text with the FontAwesome icon.

5 / 7

Oh, and it works in
R Markdown and blogdown, too!

6 / 7

Clip Code Chunks

Here's some R code in the middle of your presentation. Let your audience (or yourself) copy the code with a single click.

Hover over the chunk below to reveal the "Copy Code" button.

library(ggplot2)
ggplot(Orange) +
aes(x = age, y = circumference, colour = Tree) +
geom_point() +
geom_line() +
guides(colour = FALSE) +
theme_bw()

📱 It even works for slides viewed on phones!

2 / 7
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
Esc Back to slideshow