color.gradient: Gradient colors generation and assignment

View source: R/color.gradient.R

color.gradientR Documentation

Gradient colors generation and assignment

Description

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.

Usage

color.gradient(values, colors = c("blue", "white", "red"), bins = 100)

Arguments

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 c("blue", "white", "red").

bins

An atomic integer value to define the total number of bins/steps in which the gradient should be dived.

Value

A vector containing the assigned colors corresponding to each element of values.


sebastian-gregoricchio/Rseb documentation built on May 15, 2024, 5:45 a.m.