[R] Merge or combine data frames with missing columns

hadley wickham h.wickham at gmail.com
Tue Dec 30 01:00:39 CET 2008


Or even more simply:

On Mon, Dec 29, 2008 at 12:17 PM, Henrique Dallazuanna <wwwhsd at gmail.com> wrote:
> Try this:
>
> do.call(rbind, lapply(l, "[", unique(unlist(sapply(l, names)))))
>
> Where "l" is your list.

Or even more simply:

library(plyr)
do.call(rbind.fill, l)

which doesn't get the variable order quite right, but should in a
future version.

Hadley

-- 
http://had.co.nz/



More information about the R-help mailing list