-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.qmd
79 lines (60 loc) · 1.48 KB
/
example.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
---
title: "Quarto Theme"
subtitle: "Title Slide Subtitle"
author:
- Author One
- Another Author
format: rvalhub-revealjs
---
```{r setup}
#| echo: false
#| include: false
# manage thematic manually, in the "Future" this should work out-of-the-box
# https://github.com/quarto-dev/quarto-cli/issues/482
library(thematic)
library(ggplot2)
thematic_on(
fg = "#808080",
accent = "#4d8dc9",
bg = "transparent",
font = font_spec(scale = 1.5)
)
theme_update(
panel.background = element_rect(fill = alpha("#808080", 0.05))
)
```
## Standard Slide Format
This is how a block of text will appear. Links, such as one to [pharmar.org](https://
www.pharmar.org), will appear like this.
- Bullet item one
- Bullet item two
## Plot Output
```{r}
#| echo: true
library(ggplot2)
ggplot(mpg, aes(displ, hwy, colour = class)) +
geom_point()
```
## Other Code Cells
##### Using `#| code-line-numbers: "2,3"`
```{r}
#| code-line-numbers: "2,3"
#| echo: true
fibonacci <- function(n) {
if (n <= 1) return(0)
if (n == 2) return(1)
fibonacci(n - 1) + fibonacci(n - 2)
}
```
## Console Output
Example `base` analogs to common `dplyr` functions:
```{r, filename="script.R"}
#| echo: true
mtcars |>
subset(cyl > 2) |> # <1>
transform(qmin = qsec / 60) |> # <2>
subset(select = c("mpg", "cyl", "qmin")) |>
head()
```
1. `subset` can be used as a simple stand-in for `dplyr::filter`
2. `transform` can be used as a replacement for `dplyr::mutate`