Is there a way to automatically give names to the returned list given by purrr:map
?
For example, I run code like this very often.
fn <- function(x) { paste0(x, "_") }
l <- map(LETTERS, fn)
names(l) <- LETTERS
I'd like for the vector that is being automated upon to automatically become the names of the resulting list.
purrr::map
, but just to note thatbase::Map
does automatically assign names as desired. – Saad