I have a table (example):
Group | Country
-------------------
Group1 SE
Group1 DE
Group2 SE
Group2 DE
Group2 FI
Group3 SE
Group3 FI
I'm trying to transform it to get:
Country 1 | Country 2 | Count
-------------------------------
SE DE 2
SE FI 2
FI DE 1
I've tried using dplyr's count, group_by, summarise but I cannot seem to get my head around it. I instead got a table with each country as columns, each group as rows and a 1 or 0 in the cell if the country was in the group or not.