I want to combine several data frames which contains some common variable names as well as extra variables.
A reproducible example is as follow:
df1 <- data.frame(a=1:5, b=1:5)
df2 <- data.frame(a=1:5, b=6:10, c=11:15)
I would like to merge df1 and df2 as follow:
a b c
1 1 1 NA
2 2 2 NA
3 3 3 NA
4 4 4 NA
5 5 5 NA
6 1 6 11
7 2 7 12
8 3 8 13
9 4 9 14
10 5 10 15