rule_css: Apply a CSS style property as a conditional formatting rule

Description Usage Arguments See Also Examples

View source: R/rule_css.R

Description

Apply a CSS style property as a conditional formatting rule

Usage

1
2
rule_css(x, columns, expression, css_field, na.value = "",
  lockcells = FALSE)

Arguments

x

A condformat object, typically created with condformat()

columns

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

expression

This expression should evaluate to an array of the values

css_field

CSS style property name (e.g. "color")

na.value

CSS property value to be used in missing values (e.g. "grey")

lockcells

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

See Also

Other rule: rule_fill_bar, rule_fill_discrete, rule_fill_gradient2, rule_fill_gradient, rule_text_bold, rule_text_color

Examples

1
2
3
4
data(iris)
condformat(iris[c(1:5, 51:55, 101:105),]) %>%
  rule_css(Species, expression = ifelse(Species == "setosa", "red", "darkgreen"),
           css_field = "color")

zeehio/condformat documentation built on Nov. 16, 2018, 5:05 a.m.