-
Notifications
You must be signed in to change notification settings - Fork 1
/
template-document.qmd
126 lines (88 loc) · 2.75 KB
/
template-document.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
---
title: Title
subtitle: Subtitle
author: Your name
date: last-modified
abstract: |
This is the abstract
With multiple paragraphs
format: jgi-docx
code-fold: true
bibliography: references.bib
---
```{r}
#| include: false
# This code and output are hidden from the rendered document. Alternative the
# code alone can be hidden with echo: false, and the output alone with
# output: false.
library(tidyverse)
library(knitr)
theme_set(theme_light())
```
## Introduction
We set up variables in @lst-example-code.
```{r}
#| lst-label: lst-example-code
#| lst-cap: This the the caption for this code listing.
a = 1
b = a + 1
```
In this example: a = `{r} a` and b = `{r} b`, or if you want to use math text: $a = `{r} a`$ and $b = `{r} b`$.
Math text can also be used for full equations:
$$
E = mc^2
$$
When you have finished reading this section, you can move onto the [next section](#sec-further), which is called @sec-further.
::: {.callout-note}
This is a callout.
There are five types: `note`, `tip`, `warning`, `caution`, and `important`.
:::
## Further section {#sec-further}
We will now[^example_footnote] use the `iris` dataset^[This is an inline footnote.], a sample of which is shown in @tbl-example-table.
[^example_footnote]: This is a longer footnote.
That can span over multiple paragraphs.
```{r}
#| label: tbl-example-table
#| tbl-cap: This is the first few rows of the `iris` dataset.
#| echo: false
iris |>
head() |>
kable()
```
The full dataset is plotted in @fig-example-graph, with distributions shown in @fig-example-histograms (which includes subplots @fig-example-histogram-length and @fig-example-histogram-width).
```{r}
#| label: fig-example-graph
#| fig-cap: This is an example using the `iris` dataset.
iris |>
ggplot(aes(x = Sepal.Length, y = Sepal.Width)) +
geom_point()
```
[For example purposes we use Quarto subfigures here, although this would be better as facets/small multiple plots.]{.aside}
::: {#fig-example-histograms layout-ncol=2}
```{r}
#| label: fig-example-histogram-length
#| fig-cap: sepal length
#| fig-width: 4
#| fig-asp: 0.75
iris |>
ggplot(aes(x = Sepal.Length)) +
geom_histogram(binwidth = 0.2)
```
```{r}
#| label: fig-example-histogram-width
#| fig-cap: sepal width
#| fig-width: 4
#| fig-asp: 0.75
iris |>
ggplot(aes(x = Sepal.Width)) +
geom_histogram(binwidth = 0.2)
```
This is the distribution of the variables.
:::
## Final section
We have some references [@datahazards2024].
## Acknowledgments {.appendix}
These are the acknowledgements, a link to the [Jean Golding Institute](https://www.bristol.ac.uk/golding/) and its logo, with a caption but no figure numbering:
![The JGI logo.](logo.png)
And with figure numbering as @fig-example-image:
![The JGI logo.](logo.png){#fig-example-image}