-
Notifications
You must be signed in to change notification settings - Fork 13
/
template.qmd
158 lines (109 loc) · 3.75 KB
/
template.qmd
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
---
title: "Quarto R-Ladies Theme"
subtitle: "Inspired in the [xaringan theme](https://www.apreshill.com/slides/rladies-demo-slides.html) made by [Alison Hill](https://www.apreshill.com/) "
author: "[Bea Milz](https://twitter.com/BeaMilz)"
format:
rladies-revealjs:
footer: "[R-Ladies](https://rladies.org/) theme for [Quarto Presentations](https://quarto.org/docs/presentations/revealjs/index.html). Code available on [GitHub](https://github.com/beatrizmilz/quarto-rladies-theme)."
incremental: false
embed-resources: 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/).
## 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="#562457"}
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!
## You can add R code
```{r}
#| echo: true
library(dplyr)
library(ggplot2)
g <- starwars |>
ggplot() +
geom_point(aes(x = height, y = mass)) +
theme_light()
```
## And show the results aswell :)
```{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()` {.smaller}
With the `smaller` class in the slide!
Ex: `## slide name {.smaller}`
```{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("path-to-file.html")
```