values_to_colors | R Documentation |
Convert values to colors along a color ramp. From library(scrattch.io)
values_to_colors(x, min_val = NULL, max_val = NULL, colorset = c("darkblue", "dodgerblue", "gray80", "orange", "orangered"), missing_color = "black")
x |
a numeric vector to be converted to colors |
min_val |
a number that's used to set the low end of the color scale (default = 0) |
max_val |
a number that's used to set the high end of the color scale. If NULL (default), use the highest value in x |
colorset |
a set of colors to interpolate between using colorRampPalette (default = c("darkblue","dodgerblue","gray80","orangered","red")) |
missing_color |
a color to use for missing (NA) values. |
a character vector of hex color values generated by colorRampPalette. Color values will remain in the same order as x.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.