rule_css | R Documentation |
Apply a CSS style property as a conditional formatting rule
rule_css(x, columns, expression, css_field, na.value = "", lockcells = FALSE)
x |
A condformat object, typically created with |
columns |
A character vector with column names to be coloured. Optionally
|
expression |
This expression should evaluate to an array of the values |
css_field |
CSS style property name (e.g. |
na.value |
CSS property value to be used in missing values (e.g. |
lockcells |
logical value determining if no further rules should be applied to the affected cells. |
Other rule:
rule_fill_bar()
,
rule_fill_discrete()
,
rule_fill_gradient2()
,
rule_fill_gradient()
,
rule_text_bold()
,
rule_text_color()
data(iris)
cf <- condformat(iris[c(1:5, 51:55, 101:105),]) %>%
rule_css(Species, expression = ifelse(Species == "setosa", "red", "darkgreen"),
css_field = "color")
## Not run:
print(cf)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.