Description Usage Arguments Note
These functions change the color bar of a cell of a kable obejct. The length of the color bar is determined for each tile by the absolute percentage of the value divided by the absolute max.
.g
makes positive values green, negative values red, and zero values black
.r
does the reverse, making positive values red
1 2 3 | red_green_bars.g(x, data = NULL)
red_green_bars.r(x, data = NULL)
|
x |
A numeric column of a data.frame or data.table |
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.