title: Multiple heatmaps at once
body: <p>I am trying to get multiple heatmaps using facet_wrap and geom_tile function, I have 1000 samples.</p>
  <p>My objective is to obtain a heatmap for each Parent_Gene that include the &quot;Condition&quot; in the “X” axis, &quot;response value&quot; as a “fill” and the Genes belonging to the same Parent_Gene in the “Y” axis.</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: center;">ID</th>
  <th style="text-align: center;">sl</th>
  <th style="text-align: center;">condition</th>
  <th style="text-align: center;">Gene</th>
  <th style="text-align: center;">Response_Value</th>
  <th style="text-align: center;">Parent_Gene</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: center;">1</td>
  <td style="text-align: center;">S1</td>
  <td style="text-align: center;">disease1</td>
  <td style="text-align: center;">GeneKPN1</td>
  <td style="text-align: center;">2.749526</td>
  <td style="text-align: center;">GeneKPN</td>
  </tr>
  <tr>
  <td style="text-align: center;">2</td>
  <td style="text-align: center;">S2</td>
  <td style="text-align: center;">disease2</td>
  <td style="text-align: center;">GeneKPN2</td>
  <td style="text-align: center;">6.606618</td>
  <td style="text-align: center;">GeneKPN</td>
  </tr>
  <tr>
  <td style="text-align: center;">3</td>
  <td style="text-align: center;">S3</td>
  <td style="text-align: center;">disease1</td>
  <td style="text-align: center;">GeneBKJH1</td>
  <td style="text-align: center;">4.697644</td>
  <td style="text-align: center;">GeneBKJH</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Here is my script so far. My issue is that I just want the genes belonging to the corresponding parent_gene depicted in each heatmap and not all the genes every time.</p>
  <pre><code>my_data &lt;- read.csv(&quot;my_data.csv&quot;)
  
  my_data$Parent_Gene &lt;- gsub(&quot;([A-Z)]+)\\d+.*&quot;,&quot;\\1&quot;, my_data $Gene)
  
  library(tidyverse)
  
   gg&lt;- ggplot(my_data, aes(x=Condition, y=Gene, fill= Response_Value))+
    geom_tile(color=&quot;white&quot;, size=0.1)+
   scale_fill_viridis(name=&quot;response levels&quot;)
  
   gg + coord_equal()
  
  gg + facet_wrap(~Parent_Gene, ncol=2)
  
  gg &lt;- gg + labs(x=NULL, y=NULL, title=&quot;Comparative response levels&quot;)
  </code></pre>