Is there a way to change a the color of a single cell using formattable in R?

Viewed 22

Hello I'm new to R and I'm trying to change the color of a cell in a table generated with formattable since it is a character vector and isn't changed by the color_tile function. Here is a example of the problem. I want the cell [4,4] to pink.

dt <- data.frame( Treatment = 'SL',
                  Assay = 'AB',
                  RN8 = c(5.0,6.0,6.2,12),
                  M6 = c(15,7,0.8,'<200'))
formattable(dt, align = c(rep('c', NCOL(dt))),
            list(
              formatter('span'), area(col = 3:4) ~ color_tile('lightblue2', 'hotpink2')))

link to output

0 Answers
Related