createColors: createColors

View source: R/utilities.R

createColorsR Documentation

createColors

Description

Produce a qualitative set of colors.

Usage

createColors(variable)

Arguments

variable

character vector or factor variable.

Value

A named vector containing the color codes.

Examples

# Given qualitative variable
cond <- factor(c("A", "A", "B", "B", "C", "D"),
    levels = c("A", "B", "C", "D"))

# Associate a color to each level (or unique value, if not a factor)
cond_colors <- createColors(cond)

mcalgaro93/benchdamic documentation built on Sept. 26, 2024, 6:34 p.m.