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

Communicating with Data
via R Markdown



✨ Pretty Presentations ✨

Presented by Emi Tanaka

School of Mathematics and Statistics


dr.emi.tanaka@gmail.com @statsgen

4th October 2019 | COMBINE | Sydney, Australia

These slides are viewed best by Chrome and occasionally need to be refreshed if elements did not load properly. See here for PDF .

Background photo by Adam H. Sparks

1/10

HTML Slides from Rmd

  • There are a number of ways to make html slides in Rmd including ioslides and slidy.
  • My favorite one is xaringan 📦!
  • It's highly customisable.
  • These slides are made by xaringan!
  • Note that it uses remark.js to render the final html instead of pandoc!
2/10

xaringan easy slide separator ---

---
title: "My first xaringan slide"
subtitle: "Not!"
author: "Emi Tanaka"
date: "4th October 2019"
output:
xaringan::moon_reader
---
# Slide after title slide
---
# Next slide
Can use **markdown**!

YAML information used for title slide

No spaces after
---!

3/10

HTML/CSS

But you want to customise more?

You do need to be a ninja to do that.

Or know a bit about HTML/CSS.

HTML

<div class="bg-red">
This creates a box <br>
with red background.
</div>

CSS

.bg-red {
background-color: red;
}
OUTPUT

This creates a box
with red background.
4/10

HTML/CSS II

But the box and text look too squished.

I increase the padding here.



HTML

<div class="bg-red">
This creates a box <br>
with red background.
</div>

CSS

.bg-red {
background-color: red;
padding: 20px;
}
OUTPUT

This creates a box
with red background.
5/10

HTML/CSS III

But a white text suits better.



HTML

<div class="bg-red">
This creates a box <br>
with red background.
</div>

CSS

.bg-red {
background-color: red;
padding: 20px;
color: white;
}
OUTPUT

This creates a box
with red background.
6/10

HTML/CSS IV

In contrast, span is "inline".



HTML

<span class="bg-red">
This creates a box <br>
with red background.
</span>

CSS

.bg-red {
background-color: red;
padding: 20px;
color: white;
}
OUTPUT

This creates a box
with red background.

7/10

remark.js: div and span classes

remark.js makes it easier to write div and span elements.

Text in new line

.bg-red[
Some text
]

is converted to

<div class="bg-red">
Some text
</div>

Placing [ ] in the same line

.bg-red[Some text]

results in

<span class="bg-red">
Some text
</span>
8/10

remark.js: specify class to a whole slide

9/10

That's it!

These slides are made using xaringan R-package.

The workshop materials are licensed under .



Emi Tanaka

dr.emi.tanaka@gmail.com
@statsgen

Check that you can:

  • Be able to make slides from Rmd
  • Change the background color of a slide
10/10

HTML Slides from Rmd

  • There are a number of ways to make html slides in Rmd including ioslides and slidy.
  • My favorite one is xaringan 📦!
  • It's highly customisable.
  • These slides are made by xaringan!
  • Note that it uses remark.js to render the final html instead of pandoc!
2/10
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