getColorForClass: Get color for a class

Description Usage Arguments Details Value Examples

View source: R/getColorForClass.R

Description

Get color for a factor's class based on the parameter values.

Usage

1
2
getColorForClass(classValue, defaultColor = "blue", classes = NULL,
  colors = NULL)

Arguments

classValue

The caller wants a color for this class.

defaultColor

The default color, if we can't return with a color.

classes

A list of possibly classes.

colors

A list which contains the colors of the classes.

Details

This is basically a LUT, which finds the proper color for a factor's class. We can add the classes, the colors or a defaultColor.

Value

A color as a string.

Examples

1
2
3
4
5
6
## Not run: 
print(getColorForClass("Test",classes = c("Test", "Test2"), colors=c("red", "blue")))
print(getColorForClass("Test2"))
print(getColorForClass(NA,classes = c("Test", "Test2"), colors=c("red", "blue")))

## End(Not run)

burjandedes/randomForestDrawer documentation built on Aug. 4, 2017, 12:09 a.m.