title: Conditional formatting: making cells colorful
body: <p>is it possible to do the following:</p>
  
  <pre><code>loc1 &lt;- c("Aa", "Aa", "aa", "Aa")
  loc2 &lt;- c("aa", "aa", "aa", "AA")
  loc3 &lt;- c("aa", "Aa", "aa", "aa")
  gen &lt;- data.frame(loc1, loc2, loc3)
  
  loc1g &lt;- c(0.01, 0.5, 1, 0.75)
  loc2g &lt;- c(0.2, 0.1, 0.2, 0.6)
  loc3g &lt;- c(0.8, 0.8, 0.55, 1)
  pval &lt;- data.frame(loc1g, loc2g, loc3g)
  </code></pre>
  
  <p>I want to print to a file to gen dataframe such way that is conditionally formatted by the pval dataframe. Means than (row1, col1) of gen color depends upon pvale (row1, col1). The following are color coding:</p>
  
  <pre><code>0 to 0.3   is "red" text color 
  0.31 to 0.7 is "yellow"
  &gt; 0.7  is "red" 
  </code></pre>
  
  <p>gen[1,1] will be "Aa" printed in red text color and so on....</p>
  
  <p>appreciated your help. </p>
  
  <p>EDITS:</p>
  
  <p>I am more interested in printing not plotting in graph. If I can save output as MS excel and open in MSEXCEL it would be great. I can also be other types of text editors format that can read color coded text. As my orginal data matrix should be of a dimension of 1000 x 1000 or even more. I would like to quicky know unlying p-value for each gen categories. </p>