Skip to content
Prev 274698 / 398506 Next

Converting list of lists into dataframes

In the absence of a reproducible example (your example is not
reproducible as is), try this:

names(help.me) <- as.character(2:4)

library('plyr')
newDF <- ldply(help.me, rbind)
newDF[['.id']] <- as.numeric(newDF[['.id']])

ldply will create a new column named .id that contains the name of the
list component (hence the choice of names). The post-processing to
convert the characters to numeric values should get you the result you
want.

HTH,
Dennis
On Mon, Oct 17, 2011 at 2:11 PM, xhan <xhan at lifesci.ucsb.edu> wrote: