hcld.colors() and hot.colors() create a color table useful for
coding qualitative information and fcolor() assigns colors to categorical
(factor) values.
Arguments
- f
(factor, or vector coercible to factor) values to be converted to colors.
- col
colors for each level. Defaults to
hcld.colors().- labels
levels to use. Defaults to
levels(as.factor(f)).- n
number of colors (
>= 1) to be in the palette.- palette
a valid palette name for
hcl.colors()(one ofhcl.pals()).- ...
additional arguments passed to
legend().
Value
fcolor() returns vector of colors, one per element of f.
hcld.colors() and cat.colors() return a character vector of colors (similar to
hcl.colors() or rainbow(); see rgb()).