Suppose we have two lists:
l1 <- list("a", "b", "c")
l2 <- list("d", "e", "f")
How can we combine them into a single list to obtain this output?
[[1]]
[1] "a"
[[2]]
[1] "d"
[[3]]
[1] "b"
[[4]]
[1] "e"
[[5]]
[1] "c"
[[6]]
[1] "f"
In practice, I need a general solution that scales to lists of any size, and lists with any object (e.g., dataframe, other lists, etc). In other words, pretend that the letters in the list above are actually data.frames