-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy path29-quarto_formats.Rmd
242 lines (180 loc) · 7.33 KB
/
29-quarto_formats.Rmd
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# Quarto formats
**Learning objectives:**
- Render Quarto documents to different formats.
- Set output options for Quarto documents in different formats.
- Render documents in various formats from Quarto documents.
- Render presentations in various formats from Quarto documents.
- Create interactive web pages with Quarto.
- Group Quarto documents together into websites and books.
- Find information about other Quarto formats.
## Setting output type {-}
2 ways to set qmd output format:
1. YAML header:
```{yaml}
title: "Diamond sizes"
format: html
```
2. `quarto::quarto_render()`:
```{r eval=FALSE}
quarto::quarto_render("diamond-sizes.qmd", output_format = c("docx", "pdf"))
```
Note: `output_format` can have multiple values
## Output options {-}
- [Quarto output formats](https://quarto.org/docs/output-formats/all-formats.html)
- Some options shared (`toc: true`)
- Some format-specific (`code-fold: true` for `format: html`)
- `default` to use defaults for format
```{yaml}
format:
html:
toc: true
toc_float: true
pdf: default
docx: default
```
- `output_format = "all"` for all specified formats
## Documents {-}
Document formats:
- `pdf` = PDF with LaTeX
- `docx` = Microsoft Word
- `gfm` = GitHub Flavored Markdown
- `ipynb` = Jupyter Notebooks
## Presentations {-}
- `#` = new section, `##` = new slide
Presentation formats:
- `revealjs` = HTML presentation with revealjs
- `pptx` = PowerPoint presentation
- `beamer` = PDF presentation with LaTeX Beamer
More at [quarto.org/docs/presentations](https://quarto.org/docs/presentations)
## Interactivity {-}
`format: html` support interactivity
- {htmlwidgets} = pure client-side interactivity
- {shiny} = complex interactivity with server-side processing
- {shinylive} (not in book) = complex interactivity without server
## htmlwidgets {-}
- Handles HTML & JavaScript for you
- Many packages provide {htmlwidgets}:
- [{leaflet}](https://rstudio.github.io/leaflet/) = maps
- [{dygraphs}](https://rstudio.github.io/dygraphs) = time series visualizations
- [{DT}](https://rstudio.github.io/DT/) = tables
- [{threejs}](https://bwlewis.github.io/rthreejs) = 3d plots
- [{DiagrammeR}](https://rich-iannone.github.io/DiagrammeR) = flow charts, node-link diagrams, etc
- More at [htmlwidgets.org](https://www.htmlwidgets.org)
## Shiny {-}
```{yaml}
title: "Shiny Web App"
format: html
server: shiny
```
```{r eval=FALSE}
library(shiny)
textInput("name", "What is your name?")
numericInput("age", "How old are you?", NA, min = 0, max = 150)
```
- Code chunk with `#| context: server` for server-side code
## ShinyLive {-}
- Uses [WebR](https://docs.r-wasm.org/webr/latest/)
- No server side
- Can't (yet?) communicate with internet
- Can't hide secrets from user
[quarto-ext.github.io/shinylive](https://quarto-ext.github.io/shinylive/)
## Websites and books {-}
Quarto projects can group `.qmd`s into websites or books
- Put `.qmd` files in single directory (confirm)
- `index.qmd` = home page
- `_quarto.yml` specifies structure
```{yaml}
project:
type: book
```
- More at [quarto.org](https://quarto.org):
- [/docs/websites](https://quarto.org/docs/websites)
- [/docs/books](https://quarto.org/docs/books)
## Other formats {-}
- [Quarto Journal Templates](https://quarto.org/docs/journals/templates.html)
- [More at quarto.org](https://quarto.org/docs/output-formats/all-formats.html)
## Resources {-}
- [quarto.pub](https://quartopub.com/): Quarto publishing platform
- [github.com/mcanouil/awesome-quarto](https://github.com/mcanouil/awesome-quarto): Awesome Quarto (Quarto talks, tools, etc)
- [quarto.org](https://quarto.org/): Quarto documentation
- [github.com/quarto-dev](https://github.com/quarto-dev)
## Meeting Videos {-}
### Cohort 5 {-}
`r knitr::include_url("https://www.youtube.com/embed/2MGp74nb2ig")`
<details>
<summary> Meeting chat log </summary>
```
00:10:00 Jon Harmon (jonthegeek): bestbook.cool
00:11:26 Jon Harmon (jonthegeek): https://podcast.bestbook.cool/
00:28:01 Jon Harmon (jonthegeek): happygitwithr.com
00:30:59 Jon Harmon (jonthegeek): Remind @Sandra Muroy to share the dlab GitHub stuff when this posts to our channel. There, I think that will tag you in the post!
00:32:44 Jon Harmon (jonthegeek): xaringan
00:36:45 Jon Harmon (jonthegeek): lol, it's just called {shinydashboard}
00:48:24 Becki R. (she/her): I definitely need help with that!
00:53:08 Jon Harmon (jonthegeek): It's been a while since we learned that!
2021-08-21: Chapter 6: Workflow: scripts: Ryan Metcalf
01:01:01 Jon Harmon (jonthegeek): {pak} = updated package tracker
01:01:48 Jon Harmon (jonthegeek): {targets}
01:03:00 Federica Gazzelloni: library(pkgsnap)
01:04:15 Jon Harmon (jonthegeek): devtools::install_version()
01:05:00 Jon Harmon (jonthegeek): ?remotes::install_version()
01:05:15 Jon Harmon (jonthegeek): install_version("devtools", ">= 1.12.0, < 1.14")
01:07:07 Jon Harmon (jonthegeek): https://github.com/MangoTheCat/pkgsnap
01:11:32 Jon Harmon (jonthegeek): https://docs.ropensci.org/targets/
01:11:46 Jon Harmon (jonthegeek): pkgdown
01:12:41 Jon Harmon (jonthegeek): https://rsample.tidymodels.org/
01:13:21 Jon Harmon (jonthegeek): https://pkgdown.r-lib.org/
01:13:32 Sandra Muroy: https://github.com/dlab-berkeley/Bash-Git
```
</details>
### Cohort 6 {-}
`r knitr::include_url("https://www.youtube.com/embed/qQrnNef9fkM")`
<details>
<summary> Meeting chat log </summary>
```
00:09:51 Marielena Soilemezidi: http://www.thefunctionalart.com/p/instructors-guide.html
https://www.dropbox.com/s/gyqyz3hei7lhhmt/R_RESOURCES.txt?dl=0
https://exts.ggplot2.tidyverse.org/gallery/
00:26:20 Daniel: underscore
00:26:32 Daniel: It is called an “underscore”
00:42:17 Daniel: I can’t see the screen anymore
00:43:00 Daniel: All good now
00:44:57 Marielena Soilemezidi: https://github.com/jrnold/ggthemes)
00:55:42 Daniel: https://stackoverflow.com/questions/23957278/how-to-add-table-of-contents-in-rmarkdown
01:03:59 Daniel: It’s fine, sorry my internet went off
01:04:17 Marielena Soilemezidi: http://shiny.rstudio.com/.
01:05:04 Marielena Soilemezidi: http://rmarkdown.rstudio.com/rmarkdown_websites.html.
01:07:21 Marielena Soilemezidi: http://colinpurrington.com/tips/lab-notebooks
01:10:02 Marielena Soilemezidi: https://quarto.org/
```
</details>
### Cohort 7 {-}
`r knitr::include_url("https://www.youtube.com/embed/vkjYlBK9-9c")`
<details>
<summary> Meeting chat log </summary>
```
00:08:34 Oluwafemi Oyedele: We will start in 5 minute time!!!
00:14:37 Oluwafemi Oyedele: start
00:52:30 Oluwafemi Oyedele: https://github.com/quarto-dev/quarto-cli/tree/main/src/resources/formats/revealjs/themes
01:09:33 Oluwafemi Oyedele: https://quarto.org/docs/journals/templates.html
01:10:52 Oluwafemi Oyedele: stop
```
</details>
### Cohort 8 {-}
`r knitr::include_url("https://www.youtube.com/embed/7kW7DEWPVZ8")`
<details>
<summary> Meeting chat log </summary>
```
00:01:59 Shamsuddeen Muhammad: start
00:10:33 Ahmed Mamdouh: Im here
00:10:47 Ahmed Mamdouh: The internet is so bad sorry
00:12:18 Ahmed Mamdouh: Oh interesting
00:18:39 Ahmed Mamdouh: It like packaging all dependencies
00:25:58 Ahmed Mamdouh: Renv is like venv in python
00:29:57 Ahmed Mamdouh: Yup
00:31:32 Ahmed Mamdouh: Awesome
00:32:25 Shamsuddeen Muhammad: stop
00:32:27 Ahmed Mamdouh: Thanks alot man
00:32:50 Ahmed Mamdouh: Bye
```
</details>