suppose that we have 2 tables.
First table A:
name x y
a 1 2
b 3 4
c 5 7
d 8 7
c 5 3
b 5 4
Second table B:
name z w
a 1 9
b 3 5
c 5 2
d 8 1
b 5 9
I wish to do left join on these 2 tables on name and x and z, i.e., x and z are basically the same but with different names. Therefore, the final table should look like:
name x y w
a 1 2 9
b 3 4 5
c 5 7 2
d 8 7 1
c 5 3 2
b 5 4 9
Any idea on how to do that in R or SQL?