Open sebneus opened 10 months ago
Hi
I search for a function which trims the factor levels. It should basically work like fct_drop() but not inbetween used levels:
Example:
factor(c("b", "e"), level = c("a", "b", "c", "d", "e", "f" )) |> forcats::fct_drop() |> levels() #> [1] "b" "e" factor(c("b", "e"), level = c("a", "b", "c", "d", "e", "f" )) |> forcats::fct_trim() |> levels() #> [1] "b" "c" "d" "e"
Regards and thank you for the good job!
Hi
I search for a function which trims the factor levels. It should basically work like fct_drop() but not inbetween used levels:
Example:
Regards and thank you for the good job!