title: using apply to append text with messy results
body: <p>I would like move across columns and append text based on the value in the cell of a data table. </p>
  
  <p>Here's the current table:</p>
  
  <pre><code>table = data.frame(
      c1 = c("Under","Over"), 
      c2 = c("Under", "Over") , 
      c3 = c("NA","Under"))  
  apply(  table[, 1:3],  2,  function(x)  {
     if(x=="Under"){
         paste0("\\cellcolor{", x, "}")
      }else{ 
         paste0("\\cellcolor333{", x, "}")
     }
   })
  </code></pre>
  
  <p>right now this is not working because in column 3 for Under there should not be </p>
  
  <pre><code>\\cellcolor333 it should just be \\cellcolor
  </code></pre>
  
  <p>What the correct way?</p>