library(dplyr)
library(palmerpenguins)
penguins %>%
mutate(
long_flipper = case_when(
species == "Adelie" & flipper_length_mm > 195 ~ TRUE,
species == "Chinstrap" & flipper_length_mm > 200 ~ TRUE,
species == "Gentoo" & flipper_length_mm > 225 ~ TRUE,
TRUE ~ FALSE
)
) %>%
mutate(
body_mass_kg = body_mass_g / 1000,
bill_length_cm = bill_length_mm / 10,
bill_depth_cm = bill_depth_mm / 10
)