-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.qmd
108 lines (73 loc) · 2.46 KB
/
index.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
---
title: "Minimal Example of Tutorial in Quarto with R"
author: Raniere Silva
image: img/cover.jpg
image-alt: Computer screen showing spreadsheet app.
bibliography: references.bib
---
This example illustrates the **required** metadata by [`andrew`](https://github.com/GESIS-Methods-Hub/andrew) for a tutorial written as a Quarto Document, an extension to Markdown [@markdown2004].
Although footnotes are supported, the use of footnotes is discouraged[^1].
[^1]: Because of it makes navigation harder.
Math can be written using [LaTeX](https://www.latex-project.org/) and is render by [MathJax](https://www.mathjax.org/). Both inline, for example $x$, and standalone, for example $$x = \sqrt{a^2 + b^2}\text{,}$$ is supported.
::: {.callout-important}
To draw attention, wrap the text inside a callout blocks.
:::
Cross reference of figures, tables, equations, ... is also supported. For example, see @fig-north.
![Photo of weathercock by Mat Brown. Available at <https://www.pexels.com/photo/silhouette-of-wind-vane-552600/>.](img/north.jpg){#fig-north}
## Execution of R code
R code can be executed and the output can be included inline, for example `1 + 1` is equal to `r 1 + 1`, and standalone, for example
```{r}
a <- 1
b <- 1
a + b
```
Annotation of code blocks is also supported. For example,
```r
(3 %/% 2) != (3 %% 2) # <1>
```
1. `%%` calculates the remainder on integer division.
## Creation of figure with R
```{r}
#| echo: false
knitr::opts_chunk$set(dev = 'svg')
```
```{r}
# We need a deterministic output here because we are using this for unit testing.
# data <- runif(10, min=0, max=10)
data <- c(
9.0629027,
5.3972500,
0.4133466,
0.3981549,
6.8776325,
7.6101721,
8.9581236
)
plot(data, type='l')
```
## Dependencies
Packages that need to be installed for the reader should be listed in the `install.R` file. For example, with
```r
install.packages("jsonlite")
```
in the `install.R` file, is possible to execute
```{r}
library(jsonlite)
json <-
'[
{"Name" : "Mario", "Age" : 32, "Occupation" : "Plumber"},
{"Name" : "Peach", "Age" : 21, "Occupation" : "Princess"},
{},
{"Name" : "Bowser", "Occupation" : "Koopa"}
]'
json |>
fromJSON()
```
## Binder
The link to Binder will launch [RStudio IDE](https://posit.co/products/open-source/rstudio-server/).
:::{.callout-important}
Binder uses the information in `runtime.txt` to launch [RStudio IDE](https://posit.co/products/open-source/rstudio-server/).
:::
## References
::: {#refs}
:::