values2colors: Convert a vector of numeric values to a vector of colors

Description Usage Arguments Value

View source: R/values2colors.R

Description

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.

Usage

1
2
3
4
values2colors(x,
col.start="blue", col.end="red",
col.pal=NULL, na.col="grey50",
breaks=10)

Arguments

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 colorRampPalette.

col.pal

name of a palette from RColorBrewer; an alternative way to specify color palette. The specified palette will be passed to colorRampPalette.

na.col

color name to use for NA values in x. Defaults to "grey50".

breaks

number of intervals to break the values of x into. Defaults to 10.

Value

a vector of color names, of length equivalent to the length of x.


mjdufort/miscHelpers documentation built on Sept. 24, 2018, 7:09 p.m.