colByValue {heatmap3}R Documentation

colByValue

Description

The function colByValue convert the values in matrix into colors

Usage

colByValue(x, col, range = NA, breaks = NA, cex.axis = 2, las = 1, ...)

Arguments

x

matrix with values.

col

a list of colors such as that generated by rainbow, heat.colors, topo.colors, terrain.colors or similar functions.

range

the range of x. values out of the range will be changed to the max or min value of the range.

breaks

either a numeric vector of two or more unique cut points or a single number (greater than or equal to 2) giving the number of intervals into which x is to be cut.

cex.axis

The magnification to be used for axis annotation relative to the current setting of cex.

las

numeric in 0,1,2,3; the style of axis labels.

...

additional arguments passed on to image function to generate the color bar.

Value

A matrix with colors.

Examples

temp<-rnorm(1000)
col<-colByValue(temp,col=colorRampPalette(c('chartreuse4','white','firebrick'))(1024),range=c(-2,2))
col<-colByValue(temp,col=colorRampPalette(c('chartreuse4',
'white','firebrick'))(5),breaks=c(-5,-1,-0.1,0.1,1,5),cex.axis=0.8)

[Package heatmap3 version 1.1.9 Index]