View source: R/color.gradient.R
color.gradient | R Documentation |
Give a vector of colors generates a finite number of shadows that will be assigned to a numeric vector depending on the value of each element.
color.gradient(values, colors = c("blue", "white", "red"), bins = 100)
values |
A numeric vector containing the values to which a color must be assigned (NAs and NaN will be converted to 0). |
colors |
A string vector with the colors, in the wished order, that have to be used to generated the shadows. By default |
bins |
An atomic integer value to define the total number of bins/steps in which the gradient should be dived. |
A vector containing the assigned colors corresponding to each element of values
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.