Skip to content

Instantly share code, notes, and snippets.

View casa-henrym's full-sized avatar

Michael Henry casa-henrym

View GitHub Profile
library(tidyverse)
by_species <- iris %>%
group_by(Species) %>%
nest()
specific_models <- tibble(
Species = unique(iris$Species),
model = list(function(d) lm(Sepal.Length ~ Petal.Width + Petal.Length, d),
function(d) lm(Sepal.Length ~ Petal.Width, d),