title: Compare one row to all other rows in a file using R
body: <p>I have a file like below:</p>
  
  <pre><code>P1 A,B,C    
  P2 B,C,D,F    
  P3 C,D,E,F  
  </code></pre>
  
  <p>and I need to compare each row to all other rows to get a count of intersecting elements like below:</p>
  
  <pre><code>P1 P2 2    
  P1 P3 1    
  P2 P3 3   
  </code></pre>
  
  <p>Thank you,<br>
  S</p>