title: Creating adjacency matrix from raw data for centrality
body: <p>Following up on my previous question, I would like to create degree centrality for with the following data.</p>
  
  <p>I tried to replicate the previous example on stackoverflow (<a href="https://stackoverflow.com/questions/24841789/how-to-find-degree-centrality-of-nodes-in-a-matrix">how to find degree centrality of nodes in a matrix?</a>) but I had some challenges.</p>
  
  <pre><code> a &lt;- c('nancy','bill','bob','badri','bill','kiron','david')
   b &lt;- c('martial-arts','dance','sports','judo','judo','judo','judo')
  
   df &lt;- data.frame(a, b)
  </code></pre>
  
  <p>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?  </p>
  
  <p>I am having difficulty in creating this adjacency matrix from raw data. Can someone suggest any ideas on how to proceed. </p>