value2Color: Translate a numerical value into a color

Description Usage Arguments Value Author(s) Examples

View source: R/color-utils.R

Description

Simple function to map numerical input values into colors.

Usage

1
value2Color(x, colramp = colorRampPalette(brewer.pal(11, "RdBu"))(255), min.x, max.x, color.centered = TRUE, force.range = FALSE)

Arguments

x

The value(s) that should be translated into corresponding colors.

colramp

The color ramp that represents the color space corresponding to the numerical input space.

min.x

Smallest value to be expected as an input.

max.x

Largest value to be expected as an input.

color.centered

Whether the color bar/palette should be centered, i.e. symmetric around the central value.

force.range

If true, any input value that is larger than max.x or smaller than min.x will be set to max.x or min.x respectively.

Value

A character (vector) with corresponding color(s).

Author(s)

Johannes Rainer

Examples

1
value2Color( c( 2, 3, 1, 3 ), min.x=1, max.x=3 )

jotsetung/GenomePlotR documentation built on May 19, 2019, 9:41 p.m.