I want to combine two data frames with different and overlapping columns:
df1
X a Y b c
A P 1 Q 21 1.135899
B P 2 Q 22 1.093204
C P 3 Q 23 2.035373
D P 4 Q 24 0.350060
E P 5 Q 25 -0.939962
df2
a b d
A 1 21 5.5
A 1 21 3.3
A 1 21 2.1
B 2 22 0.8
B 2 22 0.5
C 3 23 1.3
C 3 23 6.5
C 3 23 7.1
I would like to combine both data frames in this way:
df3
a b c d
A 1 21 1.135899 5.5
A 1 21 1.135899 3.3
A 1 21 1.135899 2.1
B 2 22 1.093204 0.8
B 2 22 1.093204 0.5
C 3 23 2.035373 1.3
C 3 23 2.035373 6.5
C 3 23 2.035373 7.1
How can I achieve this?