createColors {benchdamic}R 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)

[Package benchdamic version 1.0.0 Index]