View source: R/values2colors.R
values2colors | R Documentation |
Convert a vector of numeric values to a vector of color names. The input vector is divided into a number
of intervals, set by breaks
. Values in each interval are assigned a color along a scale generated
by colorRampPalette
.
values2colors(x,
col.start = "blue", col.end = "red",
col.pal = NULL, na.col = "grey50",
breaks = 10)
x |
numeric vector containing values to be converted to colors |
col.start , col.end |
color names indicating the start and end of the color ramp. Passed to |
col.pal |
name of a palette from |
na.col |
color name to use for NA values in |
breaks |
number of intervals to break the values of |
a vector of color names, of length equivalent to the length of x.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.