R/rule_text_color.R
rule_text_color.RdGive a color to the text according to some expression
rule_text_color(x, columns, expression, na.color = "", lockcells = FALSE)A condformat object, typically created with condformat()
A character vector with column names to be coloured. Optionally
tidyselect::language() can be used.
Condition that evaluates to color names for the rows where text should be colored.
When columns selects more than one column, the expression is
evaluated once per column, with the .col pronoun bound to that
column's own values. If omitted, it defaults to .col.
Color for missing values
logical value determining if no further rules should be applied to the affected cells.
data(iris)
cf <- condformat(iris[c(1:5, 51:55, 101:105),]) |>
rule_text_color(Species, expression = ifelse(Species == "setosa", "blue", ""))
if (FALSE) { # \dontrun{
print(cf)
} # }