| fac2col | R Documentation |
Translates a factor into colors.
fac2col(x, col.pal = funky_color, na.col = "grey", seed = NULL)
x |
a numeric vector (for num2col) or a vector converted to a factor (for fac2col). |
col.pal |
(default funky_color) a function generating colors according to a given palette. |
na.col |
(default grey) the color to be used for missing values (NAs) |
seed |
(default NULL) a seed for R's random number generated, used to fix the random permutation of colors in the palette used; if NULL, no randomization is used and the colors are taken from the palette according to the ordering of the levels |
a color vector
Thibaut Jombart in adegenet package
The R package RColorBrewer, proposing a nice selection of color palettes. The viridis package, with many excellent palettes
fac2col(c("a", "b", "a", "c"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.