0

I have list 1:

l1 <- list(letters[1:26])

I have list 2:

l2 <- list(c(1:26))

How would I combine l1 and l2 into a new list l4 with 52 elements: the first 26 elements are the elements of l1 and the next 26 are the elements of l2?

Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
wy2272
  • 1

1 Answers1

1

You could use c to combine them

l4 <- c(l1[[1]], l2[[1]])

Or with unlist

l4 <- c(unlist(l1), unlist(l2))

Maybe you want to wrap it in list

l4 <- list(c(l1[[1]], l2[[1]]))
Ronak Shah
  • 377,200
  • 20
  • 156
  • 213