Skip to content
Prev 309563 / 398506 Next

convert list without same component length to matrix

try this:

l <- list(c(1,2,3,7), c(3,4,5,6,3), c(4,2,5,7), c(2,4,6,3,2), c(3,5,7,2))

sapply(l, head, 4)


I hope it helps.

Best,
Dimitris
On 11/1/2012 9:11 AM, Al Ehan wrote: