values_to_colors: Convert values to colors along a color ramp

View source: R/conversion.R

values_to_colorsR Documentation

Convert values to colors along a color ramp

Description

Convert values to colors along a color ramp

Usage

values_to_colors(
  x,
  min_val = NULL,
  max_val = NULL,
  colorset = c("darkblue", "dodgerblue", "gray80", "orange", "orangered"),
  missing_color = "black"
)

Arguments

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.

Value

a character vector of hex color values generated by colorRampPalette. Color values will remain in the same order as x.


hypercompetent/colorway documentation built on April 2, 2024, 1:44 a.m.