Description Usage Arguments Details Value Examples
Get color for a factor's class based on the parameter values.
1 2 | getColorForClass(classValue, defaultColor = "blue", classes = NULL,
colors = NULL)
|
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. |
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
.
A color as a string.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.