title: Creating a heatmap in R
body: <p>I am trying to create a heatmap of the following plot. Whenever i use the heatmap function instead of geom_point, I get this error:</p>
  <pre><code>&quot;Error in heatmap(Wizard_heatmap, aes(x = Gate)) : 'x' must be a numeric matrix&quot;
  </code></pre>
  <p>Dataframe</p>
  <pre><code>Wizard_heatmap &lt;- structure(list(Response = c(&quot;LIZARD&quot;, &quot;LIZARD&quot;, &quot;LIZARD&quot;, &quot;NR&quot;, 
                                                &quot;NR&quot;, &quot;WAITER&quot;, &quot;WEEKEND&quot;, &quot;WHALE&quot;, &quot;WHEELCHAIR&quot;, &quot;WHIP&quot;, &quot;WHISKEY&quot;, 
                                                &quot;WHISTLE&quot;, &quot;WHISTLE&quot;, &quot;WHISTLE&quot;, &quot;WIND&quot;, &quot;WINDMILL&quot;, &quot;WINDOW&quot;, 
                                                &quot;WINDOW&quot;, &quot;WINTER&quot;, &quot;WISDOM&quot;, &quot;WISDOM&quot;, &quot;WIZARD&quot;, &quot;WIZARD&quot;, &quot;WIZARD&quot;, 
                                                &quot;WIZARD&quot;, &quot;WOMEN&quot;, &quot;WOOD&quot;, &quot;WOODCHIP&quot;), 
                                   Target = c(&quot;WIZARD&quot;, &quot;WIZARD&quot;, &quot;WIZARD&quot;, &quot;WIZARD&quot;, &quot;WIZARD&quot;, &quot;WIZARD&quot;, &quot;WIZARD&quot;, &quot;WIZARD&quot;, 
                                              &quot;WIZARD&quot;, &quot;WIZARD&quot;, &quot;WIZARD&quot;, &quot;WIZARD&quot;, &quot;WIZARD&quot;, &quot;WIZARD&quot;, &quot;WIZARD&quot;, 
                                              &quot;WIZARD&quot;, &quot;WIZARD&quot;, &quot;WIZARD&quot;, &quot;WIZARD&quot;, &quot;WIZARD&quot;, &quot;WIZARD&quot;, &quot;WIZARD&quot;,
                                              &quot;WIZARD&quot;, &quot;WIZARD&quot;, &quot;WIZARD&quot;, &quot;WIZARD&quot;, &quot;WIZARD&quot;, &quot;WIZARD&quot;), 
                                   Gate = c(&quot;Full&quot;, &quot;Gate 2&quot;, &quot;Gate 3&quot;, &quot;Gate 0&quot;, &quot;Gate 1&quot;, 
                                            &quot;Gate 0&quot;, &quot;Gate 1&quot;, &quot;Gate 0&quot;, &quot;Gate 0&quot;, &quot;Gate 0&quot;, &quot;Gate 1&quot;, 
                                            &quot;Gate 0&quot;, &quot;Gate 1&quot;, &quot;Gate 2&quot;, &quot;Gate 0&quot;, &quot;Gate 0&quot;, &quot;Gate 0&quot;, 
                                            &quot;Gate 1&quot;, &quot;Gate 0&quot;, &quot;Gate 1&quot;, &quot;Gate 2&quot;, &quot;Full&quot;, &quot;Gate 1&quot;, 
                                            &quot;Gate 2&quot;, &quot;Gate 3&quot;, &quot;Gate 0&quot;, &quot;Gate 0&quot;, &quot;Gate 0&quot;), 
                                   n = c(1,  2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 1, 7,
                                         1, 15, 1, 12, 14, 1, 1, 1)), row.names = c(NA, -28L), class = c(&quot;tbl_df&quot;, &quot;tbl&quot;, &quot;data.frame&quot;))
  </code></pre>
  <p>Simple plot</p>
  <pre><code>ggplot(Wizard_heatmap, aes(x = Gate)) +
      geom_point(aes(y = Response), size = 4, color = &quot;red&quot;)+
      xlab(&quot;Gate&quot;)
  </code></pre>
  <p>This is for an error analysis, and we are trying to see where errors are concentrated. We also want to get a sense of where the errors are occurring, so that is why the x axis is sorted by gate. Lastly, in the df, you will see one of the columns is labelled &quot;n&quot;. larger &quot;n&quot; should be darker on the heatmap. Thanks in advance!</p>