title: Highlighting the maximum value of each column of data frame in R
body: <p>I have a <code>data.frame</code> in <code>R</code> :</p>
  
  <pre><code>p=structure(list(WSbin01 = c(214.98151752527, -46.9493685420515, 
  154.726947679253), WSbin02 = c(1093.46050365665, 420.318207941967, 
  927.97317496775), WSbin03 = c(2855.24990411661, 2035.57575481323, 
  2662.2595957214), WSbin04 = c(5863.91399544626, 4881.81544665127, 
  5625.17650575444), WSbin05 = c(9891.70254019722, 8845.32506336827, 
  9666.14583347469), WSbin06 = c(14562.1527820802, 13401.1727730953, 
  14321.601249974), WSbin07 = c(19091.1307681137, 18003.2115315665, 
  18903.0179613827), WSbin08 = c(24422.7094972645, 23694.5453703207, 
  24357.8071162775), WSbin09 = c(30215.4088114124, 30214.3195264298, 
  30310.242671113), WSbin10 = c(36958.2122031382, 37964.9044838778, 
  37239.6908819524), WSbin11 = c(41844.810779792, 43701.2643596447, 
  42343.7442683171), WSbin12 = c(37616.8187087318, 39348.3188777835, 
  38178.9009247311), WSbin13 = c(20953.0973658833, 21720.1930292221, 
  21251.8654076726), WSbin14 = c(7155.3786781173, 7262.61983182254, 
  7233.60584469268), WSbin15 = c(2171.61052809769, 2120.97045661101, 
  2173.49396732091), WSbin16 = c(779.72276608943, 745.52198490267, 
  767.81436310063)), .Names = c("WSbin01", "WSbin02", "WSbin03", 
  "WSbin04", "WSbin05", "WSbin06", "WSbin07", "WSbin08", "WSbin09", 
  "WSbin10", "WSbin11", "WSbin12", "WSbin13", "WSbin14", "WSbin15", 
  "WSbin16"), class = "data.frame", row.names = c(NA, -3L))
  </code></pre>
  
  <p>I would like to set a background color for the maximum value of each column.
  Using <code>DT::datatable</code> would return the table but I don't know how to set the <code>formatStyle</code> parameters to return the max value in each column in different color.</p>
  
  <p>Furthermore, I have a vector <code>z= c(1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 2, 2, 2, 2, 3, 1)</code> . I wanna have the background color in each column like if <code>z[i]=1</code> column <code>i</code> should be green, if <code>z[i]=2</code> then column <code>i</code> should be red and if <code>z[i]=3</code> the column <code>i</code> should be blue. </p>