I am wondering how to convert lists to vectors in R where each vector comprises of an element of an element of the list. In particular, I would like the 1st vector to comprise of the 1st element of each element of the list. I would like the 2nd vector to comprise of the 2nd element of each element of the list. More generally, I would like the nth vector to comprise of the nth element of each element of the list. Thus, n will equal the length of the longest element of the list.
For example, suppose we had:
mylist = list(c("a", "b"), c(character(0)), c(1, 2, 3))
I would like to create three vectors where
first_vector = c("a", NA, 1)
second_vector = c("b", NA, 2)
third_vector = c(NA, NA, 3)
As you can see in the above example, I may have additional complications due to missing values.
Thank you so much in advance for help!
-Vincent