Here is the dataset
structure(list(V1 = structure(c(2L, 3L, 4L, 5L, 3L, 4L, 5L, 4L,
5L), .Label = c("ABC", "DEF", "GHI", "JKL", "MNO"), class = "factor"),
V2 = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L), .Label = c("ABC",
"DEF", "GHI", "JKL", "MNO"), class = "factor"), Freq = c(3L,
2L, 3L, 2L, 3L, 1L, 2L, 1L, 1L)), row.names = c(NA, 9L), class = "data.frame")
which looks like this
V1 V2 Freq
1 DEF ABC 3
2 GHI ABC 2
3 JKL ABC 3
4 MNO ABC 2
5 GHI DEF 3
6 JKL DEF 1
7 MNO DEF 2
8 JKL GHI 1
9 MNO GHI 1
I would like to create something like this
x y
ABC 4
DEF 4
GHI 4
JKL 3
MNO 3
Note that ABC has an association 4 times with DEF, GHI, JKL, and MNO. This corresponds to line 1,2,3 and 4. JKL has an association 3 times with ABC,DEF, and GHI. This corresponds to line 3,6,and 8.