Skip to content

Instantly share code, notes, and snippets.

@keithmcnulty
Created September 1, 2020 10:47
Show Gist options
  • Save keithmcnulty/5c18d018b8733b9215d24565231f3280 to your computer and use it in GitHub Desktop.
Save keithmcnulty/5c18d018b8733b9215d24565231f3280 to your computer and use it in GitHub Desktop.
penguin_models <- penguins %>%
dplyr::group_by(species) %>%
dplyr::summarise(model = list(lm(body_mass_g ~ flipper_length_mm + bill_length_mm + bill_depth_mm))) # store models in a list column
penguin_models
# A tibble: 3 x 2
species model
<fct> <list>
1 Adelie <lm>
2 Chinstrap <lm>
3 Gentoo <lm>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment