-
Notifications
You must be signed in to change notification settings - Fork 0
/
xaringan_short_demo.Rmd
144 lines (97 loc) · 2.38 KB
/
xaringan_short_demo.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
---
title: "Xaringan short demo"
subtitle: "<br/>with a subtitle"
author: "Jeroen Minderman"
date: "30/10/2019 (updated: `r Sys.Date()`)"
output:
xaringan::moon_reader:
lib_dir: libs
nature:
highlightStyle: github
highlightLines: true
countIncrementalSlides: false
ratio: '16:9'
---
---
class: center, middle
# This is a centered slide with text in the middle.
### And some more text
---
class: inverse, center, middle
# This the same centered slide but with the colours reversed! :-)
---
# We can do all our other tricks with making bullet points...
- Like so
- And so
- And even nested lists work
- Here you go
With **xaringan** it is even easy to do incremental bits on slides, using the -- break instead of triple dashes to split slides.
--
Like so.
--
And so.
---
# Footnotes
Another cool convenience function is footnotes... so you can add bits at the bottom of the slide, like at the bottom of this slide.
.footnote[
I am a footnote!
]
--
In the next slide, you can see how you can have "background images" across the whole slide very easily, and tweak its size etc.
---
background-image: url("https://live.staticflickr.com/3448/3190416619_d017f9c6a3_z.jpg")
background-position: 50% 25%
background-size: 35%
class: center, bottom, inverse
## A shameless excuse to dig out my old photos...
---
# More useful (boring) tricks?
```{r,echo=FALSE}
somedata = rnorm(1000, 100, 10)
hist(somedata)
```
---
# Extended useful tricks
.pull-left[
```{r,echo=TRUE}
somedata = rnorm(1000, 100, 10)
hist(somedata)
```
]
.pull-right[
```{r,echo=FALSE}
somedata = rnorm(1000, 100, 10)
hist(somedata)
```
]
---
# After the above, the use of include_graphics may be more interesting...
## Make your plot once; but include it anywhere:
```{r, echo = TRUE}
somemoredata = data.frame(x = rnorm(1000, 0, 1),
y = rpois(1000, 20))
png("someplot.png")
plot(somemoredata$x, somemoredata$y)
dev.off()
```
---
# And then print the plot on the next slide:
.pull-left[
```{r, echo=FALSE, out.width="100%"}
knitr::include_graphics("someplot.png")
```
]
.pull-right[
This means you can just repeat the figure where you need it...
]
---
.left-column[
This is some text in the left column
This is useful if you want some banner on the left
]
.right-column[
And here is some on the right
And main text on the right
]
---
---