Map numeric ranges to cell properties
by_ranges
sets property values for cells falling within different numeric ranges.
by_ranges(breaks, values, right = FALSE, extend = TRUE, ignore_na = TRUE)
breaks |
A vector of numbers in increasing order. |
values |
A vector of property values. |
right |
If |
extend |
Extend |
ignore_na |
If |
Non-numeric cells return NA
. The effects of this depend on ignore_na
.
A function for use in map_***
functions.
Other mapping functions:
by_cases()
,
by_colorspace()
,
by_function()
,
by_quantiles()
,
by_regex()
,
by_rows()
,
by_values()
ht <- huxtable(c(1, 3, 5)) map_background_color(ht, by_ranges( c(2, 4), c("red", "yellow", "blue") )) map_background_color(ht, by_ranges( c(2, 4), "pink", extend = FALSE )) map_background_color(ht, by_ranges( c(1, 5), c("red", "yellow", "green"), right = TRUE )) map_background_color(ht, by_ranges( c(1, 5), c("red", "yellow", "green"), right = FALSE ))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.