I have a dataframe with multiple dummy variables.
df <- data.frame(A=c(1,0,1,0,1),B=c(1,1,1,0,0),C=c(0,1,0,1,1))
Acutually, the number "1" in each row represent the occurrence of varables, thus the dataframe is something like co-occurance dataframe.
I hope to transfer it into adjacency matrix.
,A,B,C
A,3,2,1
B,2,3,1
C,1,1,3
How can I do it?
update
I think here comes my answer.