Learn R Programming

colorplane (version 0.5.0)

DiscreteColorPlane-class: DiscreteColorPlane

Description

DiscreteColorPlane constructor taking list with names mapping to color values in hex representation. This object is used when one has a one to one mapping between discrete set of strings/values to discrete set of colors.

Usage

DiscreteColorPlane(lookup)

Value

a new DiscreteColorPlane instance

Arguments

lookup

a "lookup table", which is a named list mapping discrete values to hex colors

Slots

lookup

a lookup table mapping values to hex colors

Examples

Run this code

lookup <- as.list(col2hex(c("red", "blue", "green")))
names(lookup) <- c("a", "b", "c")
cp <- DiscreteColorPlane(lookup)

values <- c("a", "b", "c", "a", "c")

Run the code above in your browser using DataLab