I don't think you understand what the code is doing. It is summarising all the counts by country. This will work whether there are two countries or 200 countries.
If the example wasn't sufficient, please provide your own reproducible example:
I don't think you understand what the code is doing. It is summarising all the counts by country. This will work whether there are two countries or 200 countries.
If the example wasn't sufficient, please provide your own reproducible example: