How to reference a column in a nested dataframe (then use purrr::map)
问题 I have a very simple question about referencing data columns within a nested dataframe. For a reproducible example, I'll nest mtcars by the two values of variable am : library(tidyverse) mtcars_nested <- mtcars %>% group_by(am) %>% nest() mtcars_nested which gives data that looks like this. #> # A tibble: 2 x 2 #> # Groups: am [2] #> am data #> <dbl> <list> #> 1 1 <tibble [13 × 10]> #> 2 0 <tibble [19 × 10]> If I now wanted to use purrr::map to take the mean of mpg for each level of am I