I have data that looks like this
Cluster.x Cluster.y n
1 4 8
1 7 1
2 1 2
2 4 4
2 7 1
And i want to transform it to a crosstable that looks like this
Cluster.y
Cluster.x 1 2 3 4 5 7
1 0 2 0 8 0 1
2 2 0 0 4 0 1
3 0 0 0 0 0 0
4 8 4 0 0 0 0
5 0 0 0 0 0 0
7 1 1 0 0 0 0
How can i do this transformation? It is important for me, that the table is symmetric and is readable as rows or columns with the same results.