I'm trying to produce a list by combining two vectors of the same length element-wise. Here's a reproducible example.
a <- c(1:3)
b <- c("a", "b", "c")
Using these two vectors, I hope to create the following:
goal <- list(list(1, "a"), list(2, "b"), list(3, "c"))
I've tried a few different ways, but nothing seems to work.
list(as.list(a), as.list(b)) # Not working
as.list(as.list(a), as.list(b)) # Not working as well
as.list(outer(a,b, paste)) # Not working