Below is an illustration of a problem I am facing with a much larger dataset. I am trying to merge Dataset 2 to Dataset 1 (the master dataset). However, there are duplicates. But I would like to keep the duplicates -- i.e. add var2 to dataset 1, for all the same ID1 and ID2.
Do I have to create a loop to do so?
Many thanks in advance!!
DATASET 1
ID1 ID2 var1
1 1 1
1 1 2
1 1 3
2 1 3
2 2 2
3 1 2
3 1 2
DATASET 2
ID1 ID2 var2
1 1 4
2 1 5
2 2 7
3 1 9
Do I have to create a loop to do so?
Many thanks in advance!!
DATASET 1
ID1 ID2 var1
1 1 1
1 1 2
1 1 3
2 1 3
2 2 2
3 1 2
3 1 2
DATASET 2
ID1 ID2 var2
1 1 4
2 1 5
2 2 7
3 1 9
Comment