mapcol | R Documentation |
A simple util function that scales a factor to color based on the palette function.
mapcol(value, palette.fun = grDevices::rainbow, ...)
value |
A factor or character vector that may have n unique values. |
palette.fun |
The palette function to generate colors.
For example, |
... |
Extra arguments passed to the palette function. |
A character vector as colors, with the same length of value
. Same values
in value
will have the same color.
mapcol(iris$Species)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.