I want to map a vector to the key-value list. I would like to get a list using purrr:map (or other tidyverse method) where keys would be the characters before the first comma and values (vectors) the rest of characters. My solution using a for loop:
v <- c("a,1,2", "b,4,5,6", "c,x")
l <- list()
for(vv in v) {
vv_split <- vv %>% stringr::str_split(",")
l[[vv_split[[1]][1]]] <- vv_split[[1]][-1]
}