Skip to content

Commit ae7fb41

Browse files
authored
fixes 2 typos (#4779)
1 parent 0e64d9c commit ae7fb41

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vignettes/extending-ggplot2.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ This doesn't allow you to use different geoms with the stat, but that seems appr
492492
1. Compare and contrast `GeomPolygon` with `GeomSimplePolygon`.
493493

494494
## Geoms and Stats with multiple orientation
495-
Some layers have a specific orientation. `geom_bar()` e.g. have the bars along one axis, `geom_line()` will sort the input by one axis, etc. The original approach to using these geoms in the other orientation was to add `coord_flip()` to the plot to switch the position of the x and y axes. Following ggplot2 v3.3 all the geoms will natively work in both orientations without `coord_flip()`. The mechanism is that the layer will try to guess the orientation from the mapped data, or take direction from the user using the `orientation` parameter. To replicate this functionality in new stats and geoms there's a few steps to take. We wll look at the boxplot layer as an example instead of creating a new from scratch.
495+
Some layers have a specific orientation. `geom_bar()` e.g. have the bars along one axis, `geom_line()` will sort the input by one axis, etc. The original approach to using these geoms in the other orientation was to add `coord_flip()` to the plot to switch the position of the x and y axes. Following ggplot2 v3.3 all the geoms will natively work in both orientations without `coord_flip()`. The mechanism is that the layer will try to guess the orientation from the mapped data, or take direction from the user using the `orientation` parameter. To replicate this functionality in new stats and geoms there's a few steps to take. We will look at the boxplot layer as an example instead of creating a new one from scratch.
496496

497497
### Omnidirectional stats
498498
The actual guessing of orientation will happen in `setup_params()` using the `has_flipped_aes()` helper:
@@ -509,7 +509,7 @@ StatBoxplot$setup_data
509509

510510
The data is flipped (if needed), manipulated, and flipped back as it is returned.
511511

512-
During the computation, this sandwiching between `flip_data()` is used as well, but right before the data is returned it will also get a `flipped_aes` column denoting if the data is flipped or not. This allow the
512+
During the computation, this sandwiching between `flip_data()` is used as well, but right before the data is returned it will also get a `flipped_aes` column denoting if the data is flipped or not. This allows the
513513
stat to communicate to the geom that orientation has already been determined.
514514

515515
### Omnidirecitonal geoms

0 commit comments

Comments
 (0)