[R] Merge or combine data frames with missing columns

Lauri Nikkinen lauri.nikkinen at iki.fi
Mon Dec 29 19:11:59 CET 2008


How about this solution

g1 <- data.frame(ic = 1, y1 = 2, y2 = 3, y3 = 4, y4 = 5)
g2 <- data.frame(ic = 2, y2 = 6, y3 = 7)
g <- list(g1, g2)
library(gregmisc)
do.call(smartbind, g)

-Lauri



More information about the R-help mailing list