stats <- penguin_data %>%
group_by(species) %>%
summarize(
mean_CL = mean(culmen_length_mm, na.rm = TRUE),
SD_CL = sd(culmen_length_mm, na.rm = TRUE),
min_CL = min(culmen_length_mm, na.rm = TRUE),
Q1_CL = quantile(culmen_length_mm, 0.25, na.rm = TRUE),
median_CL = median(culmen_length_mm, na.rm = TRUE),
Q3_CL = quantile(culmen_length_mm, 0.75, na.rm = TRUE),
max_CL = max(culmen_length_mm, na.rm = TRUE),
# This chunk inside summarize repeats for CD and FL
mean_CD = mean(culmen_depth_mm, na.rm = TRUE),
SD_CD = sd(culmen_depth_mm, na.rm = TRUE),
min_CD = min(culmen_depth_mm, na.rm = TRUE),
Q1_CD = quantile(culmen_depth_mm, 0.25, na.rm = TRUE),
median_CD = median(culmen_depth_mm, na.rm = TRUE),
Q3_CD = quantile(culmen_depth_mm, 0.75, na.rm = TRUE),
max_CD = max(culmen_depth_mm, na.rm = TRUE),
mean_FL = mean(flipper_length_mm, na.rm = TRUE),
SD_FL = sd(flipper_length_mm, na.rm = TRUE),
min_FL = min(flipper_length_mm, na.rm = TRUE),
Q1_FL = quantile(flipper_length_mm, 0.25, na.rm = TRUE),
median_FL = median(flipper_length_mm, na.rm = TRUE),
Q3_Flipper_Length = quantile(flipper_length_mm, 0.75, na.rm = TRUE),
max_FL = max(flipper_length_mm, na.rm = TRUE)
)
stats