-
Notifications
You must be signed in to change notification settings - Fork 134
Open
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior
Description
library(forcats)
library(dplyr, warn.conflicts = FALSE)
by_age <- gss_cat |>
count(age, marital) |>
group_by(age) |>
mutate(
prop = n / sum(n)
)
nrow(by_age)
#> [1] 357
with(by_age, length(fct_reorder2(marital, age, prop, .na_rm = TRUE)))
#> [1] 351
with(by_age, length(fct_reorder2(marital, age, prop)))
#> Warning: `fct_reorder2()` removing 6 missing values.
#> ℹ Use `.na_rm = TRUE` to silence this message.
#> ℹ Use `.na_rm = FALSE` to preserve NAs.
#> [1] 351Created on 2023-02-27 with reprex v2.0.2
DanChaltiel
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior