rule_text_color: Give a color to the text according to some expression

View source: R/rule_text_color.R

rule_text_colorR Documentation

Give a color to the text according to some expression

Description

Give a color to the text according to some expression

Usage

rule_text_color(x, columns, expression, na.color = "", lockcells = FALSE)

Arguments

x

A condformat object, typically created with condformat()

columns

A character vector with column names to be coloured. Optionally tidyselect::language() can be used.

expression

Condition that evaluates to color names for the rows where text should be colored

na.color

Color for missing values

lockcells

logical value determining if no further rules should be applied to the affected cells.

See Also

Other rule: rule_css(), rule_fill_bar(), rule_fill_discrete(), rule_fill_gradient2(), rule_fill_gradient(), rule_text_bold()

Examples

data(iris)
cf <- condformat(iris[c(1:5, 51:55, 101:105),]) %>%
  rule_text_color(Species, expression = ifelse(Species == "setosa", "blue", ""))
## Not run: 
print(cf)

## End(Not run)

condformat documentation built on Oct. 8, 2023, 9:07 a.m.