How to transform this:
inp <- c(a = 1, b = 2, c = 3, d = 4)
into this:
list(aa = c(a = 1), bb = c(b = 2), cc = c(c = 3), dd = c(d = 4))
purrr::imap(as.list(r), ~ set_names(.x, .y)) is a good start, but the loop seems to be unnecessary. Any ideas?