-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsession-intro.qmd
166 lines (118 loc) · 4.02 KB
/
session-intro.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
159
160
161
162
163
164
165
166
---
title: "Introduction to Quarto"
subtitle: "Session - Introduction"
execute:
eval: true
---
```{r}
#| label: packages
library(emo)
library(countdown)
```
## Agenda - session one (about 3.5 hours)
Chapter overview
::: {.fragment .fade-in}
- Getting set up
- What's inside?
- Source and visual views in RStudio
:::
::: {.fragment .fade-in}
--------- Break -----------
:::
::: {.fragment .fade-in}
- Text
- Images
- Code chunks
:::
## Agenda - session two (about 3.5 hours)
Chapter overview
::: {.fragment .fade-in}
- Inline code
- Tabs
- Output Formats
:::
::: {.fragment .fade-in}
--------- Break -----------
:::
::: {.fragment .fade-in}
- Features of YAML
- Rendering
- Parameters
:::
## Course Aims
::: incremental
- Get set up using Quarto within RStudio
- To introduce Quarto as a way to produce reports/slides/books and websites
- Show the potential for using Quarto as a work flow for any analysis project
:::
## What is Quarto? Is it...
::: incremental
- "An open-source scientific and technical publishing system"
- A document format (`.qmd`)
- An R package named `{quarto}`
- A publishing system for making dynamic documents with R, Python, Julia and Observable
- "a unified authoring framework for data science, combining your code, its results, and your prose"
- Wizardry
:::
## What is Quarto - answers
::: incremental
- ["An open-source scientific and technical publishing system"](https://quarto.org/) `r emo::ji("heavy_check_mark")`
- A document format (`.qmd`) `r emo::ji("heavy_check_mark")`
- [An R package named `{quarto}`](https://github.com/quarto-dev/quarto-r) `r emo::ji("heavy_check_mark")`
- A publishing system for making dynamic documents with R, Python, Julia and Observable `r emo::ji("heavy_check_mark")`
- ["a unified authoring framework for data science, combining your code, its results, and your prose"](https://r4ds.hadley.nz/quarto.html) `r emo::ji("heavy_check_mark")`
- Wizardry `r emo::ji("wizard")`
:::
# Let's get started
## Checking first...
That everyone is:
* set up on RStudio Cloud (own laptops are fine to use instead with the latest RStudio)
:::{.callout-important collapse=false appearance='default' icon=true}
## Quarto the CLI command line interface (important)
- Quarto is an [addition](https://quarto.org/docs/get-started/) to the RStudio IDE
- {quarto} the package has functions the run some of the commands - more later
:::
## Together we'll open a Quarto template
* Go to `File/New File/Quarto document...`
* A wizard will prompt a Title and Author - select `Create`
* **Render** this document to create the html output using the blue arrow to the right
* This will prompt a name to save the file
:::{.callout-warning collapse=false appearance='default' icon=true}
## File permissions (warning)
- the file must have access to write/save files to the same folder that the `.qmd` is in
- it will create supporting files and folders and then clear them away
:::
## Your turn
Open the file `covid-analysis.qmd`, then **Render** to HTML
Try to identify these parts in the source and the output:
:::: {.columns}
::: {.column width='40%'}
1. The **metadata**
1. The **text**
1. The **code**
1. The **output**
**If this was easy**, try to find all code that produces a *plot*.
:::
::: {.column width='60%'}
```{r}
countdown::countdown(minutes = 2,
color_border = "#005EB8",
color_text = "#005EB8",
color_running_text = "white",
color_running_background = "#005EB8",
color_finished_text = "#005EB8",
color_finished_background = "white",
margin = "0.9em",
font_size = "2em")
```
:::
::::
## Basic anatomy
We look at the *underlying source* anatomy for `qmd` together:
::: {.incremental}
1. The **metadata** called a YAML (yet another markup language)
1. The **text** which supports markdown
1. The **code** for this course we'll use R but this could be other languages
1. The **output** this is an html report
:::
## End session