mapcol: Scale Qualitative Values to Color

Description Usage Arguments Value Examples

Description

A simple util function that scales a factor to color based on the palette function.

Usage

1
mapcol(value, palette.fun = grDevices::rainbow, ...)

Arguments

value

A factor or character vector that may have n unique values.

palette.fun

The palette function to generate colors. For example, terrain.colors.

...

Extra arguments passed to the palette function.

Value

A character vector as colors, with the same length of value. Same values in value will have the same color.

Examples

1
mapcol(iris$Species)

TnT documentation built on Feb. 1, 2020, 2:01 a.m.