title: Overlap matrix in R
body: <p>I've the following data frame</p>
  
  <pre><code>id channel
  1  a
  1  b
  1  c
  2  a
  2  c
  3  a
  </code></pre>
  
  <p>I would like to create and overlap matrix. It is basically a square matrix with rows &amp; column labels as a,b,c with each entry in that table showing how many id's are common to each channel. For example in the above example the matrix would look like</p>
  
  <pre><code>  a b c
  a 3 1 2
  b 1 1 1
  c 2 1 2
  </code></pre>
  
  <p>Thanks much in advance.</p>