China | Vietnam | 1 |
France | Italy | 1 |
Brazil | Argentina | 1 |
Argentina | Brazil | 1 |
Australia | United States | 0 |
United States | Australia | 0 |
Vietnam | China | 1 |
Vietnam | Thailand | 1 |
Thailand | Vietnam | 1 |
Italy | France | 1 |
And I would like the output to be this:
China | 1 |
Vietnam | 1 |
Thailand | 1 |
Italy | 2 |
France | 2 |
Brazil | 3 |
Argentina | 3 |
Australia | 4 |
United States | 5 |
My first instinct would be to sort the initial data by "samegroup", then reshape (wide to long). But that doesn't quite solve the issue and I'm not sure how to continue from there. Any help would be greatly appreciated!
0 Response to Reshape by group
Post a Comment