val2col: Convert a numeric vector into colors

Description Usage Arguments Value Examples

Description

Convert a numeric vector into colors

Usage

1
2
val2col(z, col1 = "navy", col2 = "white", col3 = "red3", nbreaks = 100,
  center = TRUE, rank = FALSE)

Arguments

z

a vector of numbers

col1

a color name for the min value, default 'navy'

col2

a color name for the middle value, default 'white'

col3

a color name for the max value, default 'red3'

nbreaks

Number of colors to be generated. Default is 30.

center

boolean, should the data be centered? Default is TRUE

rank

boolean, should the data be ranked? Default is FALSE

Value

a vector of colors

Examples

1
2
3
a<-rnorm(1000)
cols<-val2col(a)
plot(a,col=cols,pch=16)

federicogiorgi/vulcan documentation built on May 27, 2019, 7:25 a.m.