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 March 10, 2024, 10:40 p.m.