[R] collapse a list of dataframes

Tom Wright tom at maladmin.com
Mon Feb 2 22:00:12 CET 2015


Hi all,

I'm trying to avoid loops (no real reason, just as an exercise).

Given a list:

list(data.frame(a=1:3,b=letters[1:3]),data.frame(x=1:5,b=LETTERS[1:5]))

Is there an easy way to collapse this to a single dataframe

result<-data.frame(a=c(1:3,1:5),b=c(letters[1:3],LETTERS[1:5]))


Thanks



More information about the R-help mailing list