title: Generate heatmap in R (multiple independent variable)
body: <p>There are a few similar questions but they are not asking what I am looking for.
  I have a gene expression data with multiple independent variables. I want to visualize it using a heatmap in R. I am not able to include all the three variables together on the heatmap. Below is the example code:</p>
  
  <pre><code>species &lt;- rep(c("st", "rt"), each = 18)
  life &lt;- rep(c("5d", "15d", "45d"), 2, each = 6)
  concentration &lt;- rep(c("c1", "c2", "c3"), 6, each = 2)
  gene &lt;- rep(c("gene1", "gene2"), 36, each = 1)
  response &lt;- runif(36, -4, 4)
  data1 &lt;- data.frame(species, life, concentration, gene, response)
  </code></pre>
  
  <p>I am open to use any package. Please see below image which is from a different dataset. I wish to visualize my data in a similar manner.  </p>
  
  <p><a href="https://i.stack.imgur.com/Avgbg.jpg" rel="nofollow noreferrer">example_data_visualized</a></p>
  
  <p>Many thanks in advance!</p>