Best Answer · By JanBask Data Science Expert
Answered on Dec 10, 2019
Let us create two lists.
l1 <- list('a.1','a.2', 'a.3')
l2 <- list('b.1','b.2', 'b.3', 'b.4')
We can do the following way
index <- order(c(seq_along(l1), seq_along(l2))) unlist(c(l1,l2))[index] # [1] "a.1" "b.1" "a.2" "b.2" "a.3" "b.3" "b.4"