colo.scale: Interpolate colors with values or classify values by colors

Description Usage Arguments Details Value See Also

View source: R/colo.scale.R

Description

This function is used to obtain a color scale from a set of values

Usage

1
2
colo.scale(x,cols=c("white","yellow","tomato3","darkred"),rescale01=FALSE,
	center=TRUE,breaks=NULL)

Arguments

x

A numeric vector

cols

A vector of colors

center

Whether to center the middle color value at 0

rescale01

Whether to keep values between 0 and 1 to a scale going from 0 to 1. Defaults to FALSE, meaning color values will go from min to max.

breaks

A numeric vector. If breaks are given, value will be classified into each color provided the number of breaks equals the number of colors given. In other words, length(breaks) == length(cols) + 1

Details

This function is a simple wrapper for the colorRamp function.

Value

A color vector of the same length as x

See Also

colorRamp, colorRampPalette


frousseu/FRutils documentation built on April 8, 2021, 3:03 p.m.