Here's my reprex:
make_named_list <- function(x) {
list(apple = 1, banana = 2, carrot = 3)
}
tibble(x = 1:3, y = 2:4) %>%
mutate(z = map(x, make_named_list)) %>%
unnest() %>%
pull(z)
The output is a list without any names, but I would like to output a named list. I had a look at a related question here, but I'm not sure the solution applies to my (simpler?) scenario.
To be clear, the desired output is:
list(apple = 1, banana = 2, carrot = 3,
apple = 1, carrot = 2, banana = 3,
apple = 1, banana = 2, carrot = 3)