Skip to content
Prev 4789 / 398506 Next

Merging data.frames

Hello Richard,

I had the a similar problem two weeks ago. In my case, I wanted to re-merge
a dataframe that I had splitted up into a list using split(), then added
variables to each component (the same varnames everywhere). rbind seems to
work only for two dataframes at a time. So, in the end I used

unlist<-function (splitlist)
{
tempframe<-splitlist[[1]]
for (i in 2:length(splitlist))
tempframe<-rbind(tempframe,splitlist[[i]])
tempframe
}

which is not elegant in any way (R-cracks look away), but works. There may
be a very efficient and terse solution for this...

Cheers

Kaspar