map functions have some abbreviated coding for indexing nested lists. Useful snippet from the help page:
To deeply index a nested list, use multiple values; c ("x", "y") is equivalent to z [["x"]] [["y"]].
Thus, using code for nested indices along with map_dbl , which boils down to a vector, you can simply do:
mtcars %>% split(.$cyl) %>% map(~lm(mpg ~ wt, data = .)) %>% map_dbl(c(1, 1)) 4 6 8 39.57120 28.40884 23.86803
I also found this blog post introducing purrr 0.1.0 useful, as it gave some more examples of the abbreviated coding I used.
source share