NewbieDave
NewbieDave

Reputation: 1259

cbind elements in two lists using mapply

If I have two lists.

L1 <- list(a1,a2,a3)

L2 <- list(b1,b2,b3)

What's the best way to obtain a new list.

L3 <- list(c1,c2,c3)

, such that

c1 <- cbind(a1,b1)
c2 <- cbind(a2,b2)
etc...

Thank you so much,

Upvotes: 1

Views: 217

Answers (1)

Neal Fultz
Neal Fultz

Reputation: 9687

mapply(cbind, L1, L2, SIMPLIFY = FALSE)

Upvotes: 2

Related Questions