title: Color cells with specific character values in r to export to xlsx
body: <p>I'm trying to accomplish something that shouldn't be that difficult, yet it escapes my attempts.</p>
  <p>So I have an R <code>Data Frame</code> (df) which looks something like this:</p>
  <pre><code>df
  
  MeanTemperature(ºC) Longitude Latitude Height  FinalConsiderations
  5                   91ºW      152ºS    548m    Slightly Cooler
  16                  185ºE     53ºN     722m    Unchanged
  22                  16ºW      2ºS      206m    Significantly Warmer
  </code></pre>
  <p>The dataframe is a result of a filtered analyzed data. The end product is an Excel <code>(xlsx)</code> where the final column is the conclusion of the overall analysis. So, those steps are all taken care of, but these tables are rather large, so it would be nice to be able to color, for example, in <strong>RED</strong> where it says <code>&quot;Significantly Warmer&quot;</code>.</p>
  <p>I've tried using the workbook from said dataframe</p>
  <pre><code>  wb &lt;- loadWorkbook(file) #where file is the location path
   
  </code></pre>
  <p>Here I want to collect those cells where it reads 'Significantly Warmer' in red, and afterwards export the workbook to xlsx.</p>
  <pre><code> fo1 &lt;- Fill(foregroundColor=&quot;red&quot;)    # create fill object # 1
   cs1 &lt;- CellStyle(wb, fill=fo1)        # create cell style # 1
   sheets &lt;- getSheets(wb)               # get all sheets
  </code></pre>
  <p>But now I can't find a way of making a function in the wb setting where at the column</p>
  <p><code>$FinalConsiderations == 'Slightly Cooler'</code>, the cells foreground is colored red, afterwards exporting to xlsx.</p>