brewer.pal.factor | R Documentation |
The functionality has been replaced by fcbrewer
. The functions will
be removed in the future release.
brewer.pal.factor(factor, name = "Greys")
factor |
A factor vector |
name |
Color panel name to be passed to |
The function is useful to build named RGB color values from factors.
brewer.pal.factor
return a color-HTML-string vector as the same
length of the input factor vector, which is named by the input factor as
well. brewer.pal.factorLevels
returns a color vector of the length of
the factor level, and the colors are named by the levels. See examples
below.
From version 1.1-16, the color palette is automatically reduced/expanded when the levels of input factors underlies or exceeds the minimum and maximum colors. See example below.
Named HTML RGB colors.
Jitao David Zhang <jitao_david.zhang@roche.com>
## Not run:
myFac <- factor(c("HSV", "BVB", "FCB", "HSV", "BVB", "HSV"))
brewer.pal.factor(myFac, name="Set1")
brewer.pal.factorLevels(myFac, name="Set1")
myLongFac <- factor(paste("Sample", 1:20))
brewer.pal.factor(myLongFac, name="Set1")
myShortFac <- factor(paste("Sample", 1:2))
brewer.pal.factor(myShortFac, name="Set1")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.