Tweak code formatting
This commit is contained in:
parent
c2f90cc3f0
commit
e51ead6c9e
6
EDA.qmd
6
EDA.qmd
|
@ -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,
|
#| on the x-axis and ordered by increasing median highway mileage (pickup,
|
||||||
#| suv, minivan, 2seater, subcompact, compact, and midsize).
|
#| suv, minivan, 2seater, subcompact, compact, and midsize).
|
||||||
|
|
||||||
ggplot(mpg,
|
ggplot(mpg, aes(x = fct_reorder(class, hwy, median), y = hwy)) +
|
||||||
aes(x = fct_reorder(class, hwy, median), y = hwy)) +
|
|
||||||
geom_boxplot()
|
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
|
#| Side-by-side boxplots of highway mileages of cars by class. Classes are
|
||||||
#| on the y-axis and ordered by increasing median highway mileage.
|
#| on the y-axis and ordered by increasing median highway mileage.
|
||||||
|
|
||||||
ggplot(mpg,
|
ggplot(mpg, aes(x = hwy, y = fct_reorder(class, hwy, median))) +
|
||||||
aes(x = hwy, y = fct_reorder(class, hwy, median))) +
|
|
||||||
geom_boxplot()
|
geom_boxplot()
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue