Created
March 9, 2017 04:39
-
-
Save webbedfeet/43cdce8cd53bec49d1a037f7fccdb08c to your computer and use it in GitHub Desktop.
Renaming tables in a list-column
This file contains hidden or 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
| 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