Skip to content
Permalink
4aced88303
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
16 lines (13 sloc) 374 Bytes
library(dplyr)
library(tidyr)
library(palmerpenguins)
clean_data <- penguins
clean_data_2 <- clean_data %>%
mutate(across(where(is.double), ~ replace_na(.x, mean(.x, na.rm = TRUE))),
before_2008 = year < 2008) %>%
group_by(species) %>%
summarise(across(ends_with("mm"), mean)) %>%
pivot_longer(
names_to = "variable",
values_to = "value"
)