If you want to go down the purrr route, you can do something like this
library(tidyverse)
grps <- mtcars %>%
distinct(cyl, gear)
mpg_summary <- function(sub_criteria){
sub_criteria %>%
left_join(mtcars) %>%
summarise(m_mpg = mean(mpg)) %>%
pull(m_mpg)
}
grps %>%
group_nest(row_number()) %>%
pull(data) %>%
map_dbl(~mpg_summary(.x))
#> [1] 19.750 26.925 19.750 15.050 21.500 28.200 15.400 19.700
But if I was you I would go for a workflow like this
library(tidyverse)
grps <- mtcars %>%
distinct(cyl, gear)
mtcars %>%
right_join(grps) %>%
group_by(cyl, gear) %>%
summarise(m_mpg = mean(mpg)) %>%
pull(m_mpg)
#> Joining, by = c("cyl", "gear")
#> [1] 21.500 26.925 28.200 19.750 19.750 19.700 15.050 15.400