Fills the background color of a column using a gradient based on the values given by an expression
A condformat object, typically created with condformat()
A character vector with column names to be colored. Optionally
tidyselect::language()
can be used.
an expression to be evaluated with the data. It should evaluate to a logical or an integer vector, that will be used to determine which cells are to be colored.
colour for low end of gradient.
colour for mid point
colour for high end of gradient.
the value used for the middle color (the median by default)
colour space in which to calculate gradient. Must be "Lab" - other values are deprecated.
fill color for missing values
range of limits that the gradient should cover
logical value determining if no further rules should be applied to the affected cells.
The condformat_tbl object, with the added formatting information
Other rule:
rule_css()
,
rule_fill_bar()
,
rule_fill_discrete()
,
rule_fill_gradient()
,
rule_text_bold()
,
rule_text_color()
data(iris)
cf <- condformat(iris[c(1:5, 70:75, 120:125), ]) %>%
rule_fill_gradient2(Sepal.Length) %>%
rule_fill_gradient2(Species, expression=Sepal.Length - Sepal.Width)
if (FALSE) {
print(cf)
}
cf <- condformat(iris[c(1:5, 70:75, 120:125), ]) %>%
rule_fill_gradient2("Petal.Length") %>%
rule_fill_gradient2(starts_with("Sepal"), expression=Sepal.Length - Sepal.Width)
if (FALSE) {
print(cf)
}