diff --git a/EDA.qmd b/EDA.qmd index d9730a9..8b6158f 100644 --- a/EDA.qmd +++ b/EDA.qmd @@ -433,8 +433,8 @@ In the exercises, you'll be challenged to figure out why. `cut` is an ordered factor: fair is worse than good, which is worse than very good and so on. Many categorical variables don't have such an intrinsic order, so you might want to reorder them to make a more informative display. -One way to do that is with the `fct_reorder()` function. - +One way to do that is with `fct_reorder()`. +You'll learn more about that function in @sec-modifying-factor-order, but we wanted to give you a quick preview here because it's so useful. For example, take the `class` variable in the `mpg` dataset. You might be interested to know how highway mileage varies across classes: diff --git a/factors.qmd b/factors.qmd index 709f54c..154f2a5 100644 --- a/factors.qmd +++ b/factors.qmd @@ -153,7 +153,7 @@ Those operations are described in the sections below. How can you find out with a table? How can you find out with a visualization? -## Modifying factor order +## Modifying factor order {#sec-modifying-factor-order} It's often useful to change the order of the factor levels in a visualization. For example, imagine you want to explore the average number of hours spent watching TV per day across religions: