While doing my data work I have this problem. Data is as below,
row_number var1 var2
1 1921 16
2 1922 16
3 1921 17
4 1922 17
5 1703 29
6 1704 29
7 1705 29
8 1703 30
9 1704 30
10 1705 30
11 1703 31
12 1704 31
13 1705 31
I want to make pairs by only using unique var1 and unique var2.
In other words, 1~4 rows can be a group and I only need to remain 1st and 4th column. And, 5~13 rows can be an another group and I only need to remain this pair (1703 29, 1704 30, 1705 31). That is, I want to have this outcome
row_number var1 var2
1 1921 16
4 1922 17
5 1703 29
9 1704 30
13 1705 31
I have much more observations.