Skip to contents

hcld.colors() and hot.colors() create a color table useful for coding qualitative information and fcolor() assigns colors to categorical (factor) values.

Usage

fcolor(f, col = hcld.colors(length(labels)), labels = levels(as.factor(f)))

hcld.colors(n, palette = "Dark 3", ...)

cat.colors(n)

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 of hcl.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()).