tl / dr: mtcars %>% {map_df(models, function(.x) tidy(lm(data=., formula=.x)))}
Or mtcars %>% map_df(models, ~tidy(lm(..1,..2)), ..2 = .)
There are problems with the solution you tried.
First, you need to use curly braces if you want to place a point in an unusual place.
library(magrittr) 1 %>% divide_by(2)
Secondly, you cannot use the dot with the wording ~ as you planned, try map(c(1,2), ~ 3+.) And map(c(1,2), ~ 3+.x) ( or even map(c(1,2), ~ 3+..1) ), and you will see that you get the same result. By the time you use the point in the ~ formula, it is no longer associated with the pipe function.
To make sure the dot is interpreted as mtcars , you need to use the old definition of function(x) ...
It works:
mtcars %>% {map_df(models, function(.x) tidy(lm(data=., formula=.x)))}
Finally, as a bonus, this is what I came up with when trying to find a solution without braces:
mtcars %>% map(models,lm,.) %>% map_df(tidy) mtcars %>% map_df(models, ~tidy(lm(..1,..2)), ..2 = .)