cellspec_lgl {eHDPrep} | R Documentation |
Adds colour highlighting to cell values if they are encoded as logical
values. Output should then be passed to knitr
's kable
function.
cellspec_lgl(.data, rg = FALSE)
.data |
Table to be highlighted. |
rg |
Should red and green be used for |
This is useful for identifying the encoding used in a value (e.g. the
difference between the string "TRUE" and truth value of logic TRUE
).
This highlighting can also be useful when visually assessing cell values in
a table. The colour naming format (HTML or LaTeX) is automatically detected.
There are four cell types considered:
non-logical cells are coloured black)
TRUE
cells are coloured red (default) or green if rg
is TRUE
FALSE
cells are coloured cyan (default) or red if rg
is TRUE
NA
cells are coloured gray
Note: When passed to kable()
, the escape
parameter should be
FALSE
for colours to be rendered correctly.
Table with cell colours specified.