With data frames like below,
first <- data.frame(x0=1:5,
x1=rnorm(5),
x2=c("M","F","M","F","F"))
second <- data.frame(x0=10:14,
x1=rnorm(5),
x3=c("M","F","M","F","F"))
Expect a dataframe
that holds columns in both dataframes
and have NA
for the columns missing in each other.
+----+-----+-----+-----+
| x0 | x1 | x2 | x3 |
+----+-----+-----+-----+
Could have used rbind
function, however that requires same columns to be in the two dataframes.