title: Creating a heatmap from 2 columns
body: <p>I'm trying to create a heatmap from how many times the variable 1 coincides with variable 2 in R.</p>
  
  <p>Example:</p>
  
  <pre><code>Var1 | Var2
  a   |  x
  a   |  x
  b  |   x
  c  |   y
  </code></pre>
  
  <p>The combination a|x shows twice, so the heatmap should have the value 2 on row a, column x; value 1 on row b, column x; value 1 on row c, column y etc.</p>
  
  <p>The main problem is that variable 1 can have 77 different possibilities (i.e. values) and variable 2 can have another 70 different possibilities (i.e. values), for a 77x70 matrix. Total rows goes beyond 1,000,000. </p>