title: Define specific value colouring with pheatmap in R
body: <p>Let's say:</p>
  
  <pre><code>m1&lt;-matrix(rnorm(1000),ncol=100)
  </code></pre>
  
  <p>and defining colours:</p>
  
  <pre><code>cols = colorRampPalette(c("white", "red"))(30)
  </code></pre>
  
  <p>I am producing a heatmap without clustering with pheatmap function:</p>
  
  <pre><code>pheatmap(dist(t(m1)), cluster_rows = F, cluster_cols = F, show_rownames = TRUE, 
  color = cols, main = 'Heatmap')
  </code></pre>
  
  <p>the question is, how can I define colours in order to get the same heatmap but only with pixels of specific value coloured (for example less than 0.1).</p>
  
  <p>I tried to set </p>
  
  <pre><code>cols = ifelse(dist(t(m1))&lt;0.1,'red','black')
  </code></pre>
  
  <p>but didn't work.</p>