Skip to content

Instantly share code, notes, and snippets.

@jthomasmock
Created March 1, 2018 22:23
Show Gist options
  • Save jthomasmock/663a312bd722aa7fd45ebb71599d5b34 to your computer and use it in GitHub Desktop.
Save jthomasmock/663a312bd722aa7fd45ebb71599d5b34 to your computer and use it in GitHub Desktop.
library(tidyverse)
library(writexl)
library(broom)
mtcars %>%
mutate(cyl = factor(cyl),
am = factor(am)) %>%
select(disp:wt) %>%
map(~ summary(lm(.x ~ cyl * am, data = mtcars))) %>%
map( ~ tidy(.x)) %>%
writexl::write_xlsx(., "mtcars_example.xlsx")
library(tidyverse)
library(writexl)
library(broom)
mtcars %>%
mutate(cyl = factor(cyl),
am = factor(am)) %>%
select(disp:wt) %>%
map(~ summary(lm(.x ~ cyl * 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