Tweak code formatting

This commit is contained in:
Hadley Wickham 2023-02-07 10:35:12 -06:00
parent c2f90cc3f0
commit e51ead6c9e
1 changed files with 2 additions and 4 deletions

View File

@ -457,8 +457,7 @@ To make the trend easier to see, we can reorder `class` based on the median valu
#| on the x-axis and ordered by increasing median highway mileage (pickup,
#| suv, minivan, 2seater, subcompact, compact, and midsize).
ggplot(mpg,
aes(x = fct_reorder(class, hwy, median), y = hwy)) +
ggplot(mpg, aes(x = fct_reorder(class, hwy, median), y = hwy)) +
geom_boxplot()
```
@ -470,8 +469,7 @@ You can do that by exchanging the x and y aesthetic mappings.
#| Side-by-side boxplots of highway mileages of cars by class. Classes are
#| on the y-axis and ordered by increasing median highway mileage.
ggplot(mpg,
aes(x = hwy, y = fct_reorder(class, hwy, median))) +
ggplot(mpg, aes(x = hwy, y = fct_reorder(class, hwy, median))) +
geom_boxplot()
```