Maps categorical values to colors.
Arguments
- colors
A vector of colors that values will be mapped to. If
NULL
(the default), uses viridis (seegrDevices::hcl.colors()
).- domain
A vector of categorical data specifying the possible values that can be mapped.
- ordered
A
logical
scalar: should the levels be treated as already in the correct order?- missing
The color to return for
NA
values.
Value
A palette function
that when called with a single argument
(a vector of categorical values) returns a character
vector of colors.
See also
Other palettes:
palette_color()
,
palette_color_continuous()
,
palette_shape()
,
palette_size_range()