Skip to content

Instantly share code, notes, and snippets.

@webbedfeet
Created March 9, 2017 04:39
Show Gist options
  • Select an option

  • Save webbedfeet/43cdce8cd53bec49d1a037f7fccdb08c to your computer and use it in GitHub Desktop.

Select an option

Save webbedfeet/43cdce8cd53bec49d1a037f7fccdb08c to your computer and use it in GitHub Desktop.
Renaming tables in a list-column
data(mtcars)
bl <- mtcars %>%
nest(-cyl) %>%
mutate(mod = map(data, ~lm(mpg~wt, data=.) %>% tidy()) %>%
mutate(mod = map(mod, ~setNames(., paste('mymod', names(.), sep='_')))) %>%
select(-data) %>%
unnest()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment