categoricalColPal.Rd
Generate categorical ColorBrewer palette. Specify one of 'labels' or 'n' to generate categorical color palette for use with 'scale_fill_manual(values = col.pal)' and 'scale_color_manual(values = col.pal)'
categoricalColPal(labels = NULL, n = NULL, palette = "Spectral")
vector of category names that if specified will have color assigned to. Default is NULL.
number of colors. Default is NULL. Ignored if 'labels' is specified.
Name of palette. Default: "Spectral"
Vector of colors. Named if labels provided.
# generate color palette
col.pal <- categoricalColPal(n = 10)
# add to ggplot handle
gg.plt <- gg.plt + scale_fill_manual(values = col.pal)
#> Error in eval(expr, envir, enclos): object 'gg.plt' not found