In R, say I have 3 separate data frames each sharing column names with all but 1 column. How do I bind (rbind?) these together in a way where I preserve the structure for the columns named the same, but create new columns for those that are not (with blank or NA or whatever for any rows where it did not apply).
IE:
df1<-data.frame("a" = 1:2, "b" = 1:2, "c" = 1:2, "x" = 1:2)
df2<-data.frame("a" = 3:4, "b" = 3:4, "c" = 3:4, "y" = 3:4)
df3<-data.frame("a" = 5:6, "b" = 5:6, "c" = 5:6, "z" = 5:6)
> df1
a b c x
1 1 1 1 1
2 2 2 2 2
> df2
a b c y
1 3 3 3 3
2 4 4 4 4
> df3
a b c z
1 5 5 5 5
2 6 6 6 6
I would like to get as my final result:
a b c x y z
1 1 1 1 1
2 2 2 2 2
3 3 3 3 3
4 4 4 4 4
5 5 5 5 5
6 6 6 6 6