I have data like the SampleData below, which has lists of different length that I\'d like to combine in to a data frame like the Desired Result below. I\'ve tried using lap
Here is a modified version with length<- assignment
length<-
setNames(do.call(cbind.data.frame, lapply(lapply(SampleData, unlist), `length<-`, max(lengths(SampleData)))), paste0("V", 1:3)) # V1 V2 V3 #1 1 1 3 #2 2 2 4 #3 3 NA 6 #4 NA NA 7