From 7dbe3f94873ad092437ec64e5779653bd90ef582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mine=20=C3=87etinkaya-Rundel?= Date: Mon, 9 May 2022 13:31:21 -0400 Subject: [PATCH] fct_infreq results in decreasing order, closes #948 --- factors.Rmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/factors.Rmd b/factors.Rmd index 4211955..0a35715 100644 --- a/factors.Rmd +++ b/factors.Rmd @@ -274,8 +274,8 @@ ggplot(by_age, aes(age, prop, colour = fct_reorder2(marital, age, prop))) + labs(colour = "marital") ``` -Finally, for bar plots, you can use `fct_infreq()` to order levels in increasing frequency: this is the simplest type of reordering because it doesn't need any extra variables. -Combine it with `fct_rev()` if you want the largest values on the right, not the left. +Finally, for bar plots, you can use `fct_infreq()` to order levels in decreasing frequency: this is the simplest type of reordering because it doesn't need any extra variables. +Combine it with `fct_rev()` if you want them in increasing frequency so that in the bar plot largest values are on the right, not the left. ```{r} #| fig.alt: >