title: How to use conditional formatting for values based on scale in other values in the row
body: <p>I would like to use conditional formatting in <code>kable</code> / <code>kableExtra</code> to color the values based on the range in the row.  I have found plenty of examples for how to do it by values in the column, but am struggling to do it by row.</p>
  <p>Here is an example by column values:</p>
  <pre><code>require(tidyverse)
    require(knitr)
    require(kableExtra)
    iris[1:10, ] %&gt;%
      mutate_if(is.numeric, function(x) {
        cell_spec(x, bold = T, 
                  color = spec_color(x, end = 0.9),
                  font_size = spec_font_size(x))
      }) %&gt;%
      mutate(Species = cell_spec(
        Species, color = &quot;white&quot;, bold = T,
        background = spec_color(1:10, end = 0.9, option = &quot;A&quot;, direction = -1)
      )) %&gt;%
      kable(escape = F, align = &quot;c&quot;) %&gt;%
      kable_styling(c(&quot;striped&quot;, &quot;condensed&quot;), full_width = F)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/btbQe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/btbQe.png" alt="enter image description here" /></a></p>
  <p>However, I would like the color to be determined by the range of values in each row. In this example of course the first column is always largest and last is smallest, so they would all go in that direction, but in my actual data the location of highest and lowest values is in different columns for each row.</p>