rule_fill_gradient2: Fill column with divergent colour gradient

Description Usage Arguments Value See Also Examples

Description

Fills the background color of a column using a three colors gradient based on the values of an expression

Usage

1
2
3
rule_fill_gradient2(..., expression, low = scales::muted("red"),
  mid = "white", high = scales::muted("blue"), midpoint = NA,
  space = "Lab", na.value = "#7F7F7F", limits = NA, lockcells = FALSE)

Arguments

...

Comma separated list of unquoted column names. If expression is also given, then this list can use any of the select syntax possibilities.

expression

an expression to be evaluated with the data. It should evaluate to a numeric vector, that will be used to determine the colour gradient level.

low

colour for low end of gradient.

mid

colour for mid point

high

colour for high end of gradient.

midpoint

the value used for the middle color (the median by default)

space

colour space in which to calculate gradient. Must be "Lab" - other values are deprecated.

na.value

fill color for missing values

limits

range of limits that the gradient should cover

lockcells

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

Value

The condformat_tbl object, with the added formatting information

See Also

Other rule: rule_fill_discrete_, rule_fill_discrete, rule_fill_gradient2_, rule_fill_gradient_, rule_fill_gradient

Examples

1
2
3
4
data(iris)
condformat(iris[c(1:5, 70:75, 120:125), ]) +
 rule_fill_gradient2(Sepal.Length) +
 rule_fill_gradient2(Species, expression=Sepal.Length - Sepal.Width)


Search within the condformat package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.