Use by_values() to set properties for cells with specific,
pre-determined contents.
Arguments
- ...
Name-value pairs like
name = value. Cells where contents are equal tonamewill have the property set tovalue. If there is a single unnamed argument, this is the default value for unmatched cells. More than one unnamed argument is an error.- ignore_na
If
TRUE,NAvalues in the result will be left unchanged from their previous values. Otherwise,NAnormally resets to the default.
See also
Other mapping functions:
by_cases(),
by_colorspace(),
by_function(),
by_quantiles(),
by_ranges(),
by_regex(),
by_rows()
Examples
ht <- hux(letters[1:3])
map_background_color(
ht,
by_values(a = "red", c = "yellow")
)
#> a
#> b
#> c
map_background_color(
ht,
by_values(a = "red", c = "yellow", "green")
)
#> a
#> b
#> c