Hi array (?),

Hi, I would like to rbind 2 data frames. They both some common column names, 
but also some unique column names each, is there any simple function that rbind 
these 2 data frames with filling NAs for those columns of unique names?

You can use the reshape package by Hadley Wickham for this:


df1 <- data.frame(V1 = rnorm(10),
                  V2 = rnorm(10),
                  V4 = rnorm(10))
df2 <- data.frame(V1 = rnorm(10),
                  V3 = rnorm(10),
                  V4 = rnorm(10))
library(reshape)
rbind.fill(df1, df2)

HTH,
Tobias

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to