Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
penguins <- palmerpenguins::penguins
penguins %>%
filter(!is.na(sex)) %>%
mutate(bm_quart = gtools::quantcut(body_mass_g, q=4))
penguins_2 <- penguins %>%
filter(!is.na(sex)) %>%
select(species, sex, body_mass_g) %>%
# mutate(bm_quart = gtools::quantcut(body_mass_g, q=4))
mutate(bm_quart = as.integer(gtools::quantcut(body_mass_g, q=4))) %>%
mutate(bm_quart = as.factor(bm_quart))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.