title: Applying a criterion to a single column of a table in pander
body: <p>I want to apply a criterion according to which cells in a pander table are made bold or not. However I want to apply this criterion to a single column of the table not to other columns.</p>
  
  <p>Here is the full markdown document.</p>
  
  <pre><code>---
  title: "Untitled"
  output: pdf_document
  ---
  
  ```{r setup, include=FALSE}
  knitr::opts_chunk$set(echo = TRUE)
  ```
  
  
  ```{r toy data}
  
  pVal &lt;- as.character(c(0.9, 0.04, 0.6, 0.0003))
  FVal &lt;- as.character(c(0.03, 2.51, 1.7, 32.1))
  Group &lt;- c("A", "B", "C", "D")
  df &lt;- data.frame(Group, FVal, pVal, stringsAsFactors = FALSE)
  
  library(pander)
  
  emphasize.strong.cells(which(df &lt; 0.05, arr.ind = TRUE))
  
  pander(df)
  ```
  </code></pre>
  
  <p>There are two problems here.</p>
  
  <p>First is the fact that the values that fulfill the criterion in the <code>FVal</code> column are also made bold. I want the values &lt;.05 made bold in the <code>pVal</code> column <em>only</em>. I tried subsetting in the <code>emphasize.strong.cells</code> function like so  </p>
  
  <pre><code>emphasize.strong.cells(which(df$pVal &lt; 0.05, arr.ind = TRUE))
  </code></pre>
  
  <p>or </p>
  
  <pre><code>emphasize.strong.cells(which(df[,"pVal"] &lt; 0.05, arr.ind = TRUE))
  </code></pre>
  
  <p>But neither worked. I suspect this is happening because subsetting this way I am not giving the <code>emphasize.strong.cells</code> function an object with several dimensions but I am not sure how to make an object like that where only one column is 'active' for the criterion.</p>
  
  <p>The second issue is that the final element in the <code>pVal</code> column is not made bold in the final rmarkdown pdf, i assume because of the transformation to scientific notation.</p>
  
  <p>Any solutions much appreciated.</p>