Description Usage Arguments Note
These functions shade the background of a kable cell either red or green, preserving the distance from zero which remains white.
.g
makes positive values green and negative values red
.r
makes negative values green and positive values red
w2rg()
is the function that creates the html colors to be passed to red_green_tiles.
1 2 3 4 5 | red_green_tiles.g(x, data = NULL)
red_green_tiles.r(x, data = NULL)
w2rg(x, green_up = T)
|
x |
A numeric column of a data.frame or data.table |
green_up |
Logical, default is TRUE where green values are positive. Though a user is unlikely to ever use w2rg by itself |
For best usage, apply the color transformation with mutate() and then pass the mutated object through kable() with escape = F and format = 'html'. If kableExtra::kable_styling() is used then use protect_latex = F.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.