title: How to build a confusion matrix for a dataframe
body: <p>I have the following dataframe:</p>
  
  <pre><code>v1  v2  v3  v4  v5
  0   t   1   12  N/A
  1   t   0   34  N/A
  2   t   1   45  N/A
  5   f   0   76  N/A
  12  f   0   98  N/A
  45  t   1   45  M
  </code></pre>
  
  <p>I want to be able to construct the following confusion matrix on the two columns v2 and v3:</p>
  
  <pre><code>    t  |  f
   0  1     2
   1  3     0
  </code></pre>
  
  <p>What is the most elegant way to do this in R</p>