From 4b340b83b80845881dae807de56554cce7504b2e Mon Sep 17 00:00:00 2001 From: "Y. Yu" <54338793+PursuitOfDataScience@users.noreply.github.com> Date: Tue, 16 Aug 2022 12:38:22 -0400 Subject: [PATCH] Update factors.qmd (#1067) Fixed few errors. --- factors.qmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/factors.qmd b/factors.qmd index e875d95..ff0d7cb 100644 --- a/factors.qmd +++ b/factors.qmd @@ -88,7 +88,7 @@ If you omit the levels, they'll be taken from the data in alphabetical order: factor(x1) ``` -Sometimes you'd prefer that the order of the levels match the order of the first appearance in the data. +Sometimes you'd prefer that the order of the levels matches the order of the first appearance in the data. You can do that when creating the factor by setting levels to `unique(x)`, or after the fact, with `fct_inorder()`: ```{r} @@ -339,7 +339,7 @@ gss_cat |> count(partyid) ``` -`fct_recode()` will the leave levels that aren't explicitly mentioned as is, and will warn you if you accidentally refer to a level that doesn't exist. +`fct_recode()` will leave levels that aren't explicitly mentioned as is, and will warn you if you accidentally refer to a level that doesn't exist. To combine groups, you can assign multiple old levels to the same new level: