Last active
March 2, 2018 14:48
-
-
Save jthomasmock/2c76f138bbd2008c275ca0ec863e11d6 to your computer and use it in GitHub Desktop.
With tidyverse, purrr and writexl, you can generate many models simultaneously and save them to individual sheets in Excel!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(writexl) | |
library(broom) | |
mtcars %>% | |
select(disp:wt) %>% | |
map(~ summary(lm(.x ~ factor(cyl) * factor(am), data = mtcars))) %>% | |
map( ~ tidy(.x)) %>% | |
writexl::write_xlsx(., "mtcars_example.xlsx") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment