title: Counting unique pairs of categorical variables in R
body: <p>If I have this data:</p>
  
  <pre><code>One &lt;- c(rep("X",4),rep("Y",3),rep("Z",2))
  Two &lt;- c(rep("A",2),rep("B",6),rep("C",1))
  
  df &lt;- data.frame(One,Two) 
  
    One Two
  1   X   A
  2   X   A
  3   X   B
  4   X   B
  5   Y   B
  6   Y   B
  7   Y   B
  8   Z   B
  9   Z   C
  </code></pre>
  
  <p>I want to find the frequency of unique pairs (one,two). I know if I wanted to find the frequency of different elements in column <code>One</code> I would do <code>table(df$one)</code>. How about the frequency of unique pairs?</p>