I have a way that works and one that does not, and I cannot figure out what's wrong with the latter. Here:
library(tidyverse)
get_these <- c(`Ideal E` = "cut == 'Ideal' & color == 'E'",
`Good J` = "cut == 'Good' & color == 'J'")
# This works:
get_these %>%
map(rlang::parse_expr) %>%
map(function(pick_these)
diamonds %>%
filter(!!pick_these)) %>%
tibble(goods = .) %>%
mutate(wat = names(get_these))
# This does not:
tibble(pick_these = get_these %>%
map(rlang::parse_expr)) %>%
mutate(wat = names(get_these),
goods = list(diamonds)) %>%
mutate(goods = pmap(.l = dplyr::select(.,
goods,
pick_these),
.f = function(goods, pick_these) {
goods %>% filter(!!pick_these)
})) %>%
dplyr::select(goods, wat)