forked from malcolmbarrett/kakashi-quarto-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.rmarkdown
229 lines (133 loc) · 4.05 KB
/
template.rmarkdown
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
---
title: "Kakashi Theme, Tweaked"
subtitle: "Forked from Malcolm Barrett"
author:
- name: "John McLevey"
affiliation: "Sociology, Memorial University"
date: last-modified
date-format: "MMMM D, YYYY"
format: kakashi-revealjs
bibliography: references.bib
output-dir: docs
---
```{r setup, include=FALSE}
options(
tibble.max_extra_cols = 6,
tibble.width = 60
)
# install.packages("gt", repos = "https://cran.rstudio.com/", dependencies = TRUE) # , quiet = TRUE
# install.packages("pagedown", repos = "https://cran.rstudio.com/", dependencies = TRUE)
```
## Quarto
Quarto enables you to weave together content and executable code into a finished presentation.
To learn more about Quarto presentations see <https://quarto.org/docs/presentations/>.
> This is part of the [Quarto documentation](https://quarto.org/docs/presentations/).
@mcelreath2020statistical testing a cite...
## Bullets
When you click the **Render** button a document will be generated that includes:
- Content authored with markdown
- Output from executable code
> This is part of the [Quarto documentation](https://quarto.org/docs/presentations/).
## Code
When you click the **Render** button a presentation will be generated that includes both content and the output of embedded code.
You can embed code like this:
```{r}
#| echo: true
1 + 1
```
> This is part of the [Quarto documentation](https://quarto.org/docs/presentations/).
You can also add `text marked as code`!
# New topic! {background-color="#23373B"}
To make a slide like this, use:
# Title of slide {background-color="#562457"}
## Tabset example
::: panel-tabset
## Example 1
Content here for tabset 1 :)
## Example 2
More content here, for tabset 2 :)
:::
## Incremental content
*Hi!*
. . .
Use `. . .` to separate content as an incremental slide!
. . .
Bye!
## Numbers
1. **thing 1**
1. *thing 2*
1. ~~thing 3~~
## Non-Incremental lists
::: {.nonincremental}
- **thing 1**
- *thing 2*
- ~~thing 3~~
:::
## You can add R code
```{r}
#| code-line-numbers: "|2,4|5|6"
library(dplyr)
library(ggplot2)
g <- starwars |>
ggplot() +
geom_point(aes(x = height, y = mass)) +
theme_light()
```
## And show the results, as well :)
```{r}
#| fig.align: center
#| echo: true
g
```
## What about tables? {.smaller}
### `knitr::kable()`
::: columns
::: {.column width="50%"}
```{r}
#| label: kable-ex
#| echo: true
#| eval: false
tab <- starwars |>
tidyr::drop_na(species) |>
group_by(species) |>
summarise(
n = n(),
mean_heigth = round(mean(height, na.rm = TRUE)),
mean_mass = round(mean(mass, na.rm = TRUE))
) |>
slice_max(order_by = n, n = 4)
knitr::kable(tab)
```
:::
::: {.column width="50%"}
```{r}
#| label: kable-ex
#| eval: true
```
:::
:::
## `DT::datatable()` {.small}
With the `smaller` class in the slide!
Ex: `## slide name {.small}`
```{r}
DT::datatable(tab, options = list(pageLength = 5))
```
## `gt::gt()`
```{r}
gt::gt(tab)
```
## `reactable::reactable()`
```{r}
reactable::reactable(tab)
```
## Diagrams with Mermaid!
Read about how to create a diagram in this [post by Mine Çetinkaya-Rundel](https://mine-cetinkaya-rundel.github.io/quarto-tip-a-day/posts/21-diagrams/).
<center>
<blockquote class="twitter-tweet" data-conversation="none"><p lang="en" dir="ltr"><a href="https://twitter.com/hashtag/quartotip?src=hash&ref_src=twsrc%5Etfw">#quartotip</a> 21: Create diagrams in Quarto documents using Mermaid or Graphviz in executable code cells, similar to how you create figures.<br><br>Read more: <a href="https://t.co/3qx9oSNCay">https://t.co/3qx9oSNCay</a> <a href="https://t.co/fYzGcISl4h">pic.twitter.com/fYzGcISl4h</a></p>— Quarto (@quarto_pub) <a href="https://twitter.com/quarto_pub/status/1549271325943947270?ref_src=twsrc%5Etfw">July 19, 2022</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</center>
## Exporting into PDF
You can use the function `pagedown::chrome_print()` to print the HTML version into a PDF!
```{r}
pagedown::chrome_print("template.html")
```
## References