Reputation: 719
I would like to combine two lists:
data1 data2
a 1 a 1
b 2 b 2
c 3 c 3
d 4 f 6
e 5 g 7
so that the final product is:
data3
a 1
b 2
c 3
d 4
e 5
f 6
g 7
I have tried using variations of merge, but inevitably end up loosing something from each list.
Thank you for your help! Thank you!
Upvotes: 0
Views: 3158
Reputation: 4826
use the argument all=TRUE
of merge
:
merge(data1,data2,all=TRUE)
Upvotes: 6