Closed hadley closed 1 year ago
library(dplyr, warn.conflicts = FALSE) library(forcats) starwars |> mutate(hair_color = fct_infreq(hair_color)) |> count(hair_color) |> filter(n > 1) #> # A tibble: 6 × 2 #> hair_color n #> <fct> <int> #> 1 none 37 #> 2 brown 18 #> 3 black 13 #> 4 white 4 #> 5 blond 3 #> 6 <NA> 5
Created on 2023-01-03 with reprex v2.0.2
It can't reorder implicit NAs, so we probably need to document this and show how to convert to explicit.
Created on 2023-01-03 with reprex v2.0.2