Following up on my previous question, I would like to create degree centrality for with the following data.
I tried to replicate the previous example on stackoverflow (how to find degree centrality of nodes in a matrix?) but I had some challenges.
a <- c('nancy','bill','bob','badri','bill','kiron','david')
b <- c('martial-arts','dance','sports','judo','judo','judo','judo')
df <- data.frame(a, b)
From this data i need to create an adjacency matrix : (where u1, u2, u3, u4,u5,u6 represents nancy, bill,bob, badri users and how they are connected through the clubs they are participating in). Can someone help?
I am having difficulty in creating this adjacency matrix from raw data. Can someone suggest any ideas on how to proceed.