Skip to content

Commit a37a599

Browse files
committed
move knitr chunk options to yaml
1 parent c657ca1 commit a37a599

File tree

11 files changed

+73
-68
lines changed

11 files changed

+73
-68
lines changed

vignettes/articles/faq-annotation.qmd

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
title: "FAQ: Annotation"
33
format: html
4+
knitr:
5+
opts_chunk:
6+
collapse: true
7+
comment: "#>"
8+
fig-dpi: 300
9+
fig-asp: 0.618
10+
fig-width: 6
11+
out-width: "80%"
412
---
513

614
```{=html}
@@ -18,14 +26,6 @@ format: html
1826
#| include: false
1927
library(ggplot2)
2028
library(dplyr)
21-
knitr::opts_chunk$set(
22-
fig.dpi = 300,
23-
collapse = TRUE,
24-
comment = "#>",
25-
fig.asp = 0.618,
26-
fig.width = 6,
27-
out.width = "80%"
28-
)
2929
```
3030

3131

vignettes/articles/faq-axes.qmd

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
title: "FAQ: Axes"
33
format: html
4+
knitr:
5+
opts_chunk:
6+
collapse: true
7+
comment: "#>"
8+
fig-dpi: 300
9+
fig-asp: 0.618
10+
fig-width: 6
11+
out-width: "80%"
412
---
513

614
```{=html}
@@ -17,13 +25,6 @@ format: html
1725
```{r}
1826
#| include: false
1927
library(ggplot2)
20-
knitr::opts_chunk$set(
21-
fig.dpi = 300,
22-
collapse = TRUE,
23-
comment = "#>",
24-
fig.asp = 0.618,
25-
fig.width = 6,
26-
out.width = "80%")
2728
```
2829

2930
## Label placement

vignettes/articles/faq-bars.qmd

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
title: "FAQ: Barplots"
33
format: html
4+
knitr:
5+
opts_chunk:
6+
collapse: true
7+
comment: "#>"
8+
fig-dpi: 300
9+
fig-asp: 0.618
10+
fig-width: 6
11+
out-width: "80%"
412
---
513

614
```{=html}
@@ -19,15 +27,6 @@ format: html
1927
library(ggplot2)
2028
library(dplyr)
2129
library(tidyr)
22-
23-
knitr::opts_chunk$set(
24-
fig.dpi = 300,
25-
collapse = TRUE,
26-
comment = "#>",
27-
fig.asp = 0.618,
28-
fig.width = 6,
29-
out.width = "80%"
30-
)
3130
```
3231

3332
## Colors

vignettes/articles/faq-customising.qmd

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
title: "FAQ: Customising"
33
format: html
4+
knitr:
5+
opts_chunk:
6+
collapse: true
7+
comment: "#>"
8+
fig-dpi: 300
9+
fig-asp: 0.618
10+
fig-width: 6
11+
out-width: "80%"
412
---
513

614
```{=html}
@@ -18,14 +26,6 @@ format: html
1826
#| include: false
1927
library(ggplot2)
2028
library(tibble)
21-
knitr::opts_chunk$set(
22-
fig.dpi = 300,
23-
collapse = TRUE,
24-
comment = "#>",
25-
fig.asp = 0.618,
26-
fig.width = 6,
27-
out.width = "80%"
28-
)
2929
```
3030

3131
## Legends

vignettes/articles/faq-faceting.qmd

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
title: "FAQ: Faceting"
33
format: html
4+
knitr:
5+
opts_chunk:
6+
collapse: true
7+
comment: "#>"
8+
fig-dpi: 300
9+
fig-asp: 0.618
10+
fig-width: 6
11+
out-width: "80%"
412
---
513

614
```{=html}
@@ -17,13 +25,6 @@ format: html
1725
```{r}
1826
#| include: false
1927
library(ggplot2)
20-
knitr::opts_chunk$set(
21-
fig.dpi = 300,
22-
collapse = TRUE,
23-
comment = "#>",
24-
fig.asp = 0.618,
25-
fig.width = 6,
26-
out.width = "80%")
2728
```
2829

2930
## Panes

vignettes/articles/faq-reordering.qmd

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
title: "FAQ: Reordering"
33
format: html
4+
knitr:
5+
opts_chunk:
6+
collapse: true
7+
comment: "#>"
8+
fig-dpi: 300
9+
fig-asp: 0.618
10+
fig-width: 6
11+
out-width: "80%"
412
---
513

614
```{=html}
@@ -19,15 +27,6 @@ format: html
1927
library(ggplot2)
2028
library(dplyr)
2129
library(tibble)
22-
23-
knitr::opts_chunk$set(
24-
fig.dpi = 300,
25-
collapse = TRUE,
26-
comment = "#>",
27-
fig.asp = 0.618,
28-
fig.width = 6,
29-
out.width = "80%"
30-
)
3130
```
3231

3332
## Bar plots

vignettes/extending-ggplot2.qmd

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
---
22
title: "Extending ggplot2"
3+
knitr:
4+
opts_chunk:
5+
collapse: false
6+
comment: "#>"
7+
fig-width: 7
8+
fig-height: 7
9+
fig-align: "center"
310
description: |
411
Official extension mechanism provided in ggplot2.
512
vignette: >
@@ -10,7 +17,6 @@ vignette: >
1017

1118
```{r}
1219
#| include: false
13-
knitr::opts_chunk$set(collapse = TRUE, comment = "#>", fig.width = 7, fig.height = 7, fig.align = "center")
1420
library(ggplot2)
1521
```
1622

vignettes/ggplot2-in-packages.qmd

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
---
22
title: "Using ggplot2 in packages"
3+
knitr:
4+
opts_chunk:
5+
collapse: true
6+
comment: "#>"
7+
fig-show: "hide"
38
description: |
49
Customising how aesthetic specifications are represented on your plot.
510
vignette: >
@@ -10,7 +15,6 @@ vignette: >
1015

1116
```{r}
1217
#| include: false
13-
knitr::opts_chunk$set(collapse = TRUE, comment = "#>", fig.show = "hide")
1418
library(ggplot2)
1519
```
1620

vignettes/ggplot2-specs.qmd

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
---
22
title: "Aesthetic specifications"
3+
knitr:
4+
opts_chunk:
5+
collapse: true
6+
comment: "#>"
7+
fig-dpi: 96
38
description: |
49
Customising how aesthetic specifications are represented on your plot.
510
vignette: >
@@ -11,7 +16,6 @@ vignette: >
1116
```{r}
1217
#| include: false
1318
library(ggplot2)
14-
knitr::opts_chunk$set(fig.dpi = 96, collapse = TRUE, comment = "#>")
1519
```
1620

1721
This vignette summarises the various formats that grid drawing functions take. Most of this information is available scattered throughout the R documentation. This appendix brings it all together in one place.

vignettes/ggplot2.qmd

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
---
22
title: "Introduction to ggplot2"
3+
knitr:
4+
opts_chunk:
5+
collapse: true
6+
comment: "#>"
37
description: |
48
An overview of the layered grammar of graphics.
59
vignette: >
@@ -8,14 +12,6 @@ vignette: >
812
%\VignetteEncoding{UTF-8}
913
---
1014

11-
```{r}
12-
#| include: false
13-
knitr::opts_chunk$set(
14-
collapse = TRUE,
15-
comment = "#>"
16-
)
17-
```
18-
1915
ggplot2 is an R package for producing visualizations of data.
2016
Unlike many graphics packages, ggplot2 uses a conceptual framework based on the grammar of graphics.
2117
This allows you to 'speak' a graph from composable elements, instead of being limited to a predefined set of charts.

0 commit comments

Comments
 (0)