mapcol: Scale Qualitative Values to Color

mapcolR Documentation

Scale Qualitative Values to Color

Description

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

Usage

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

mapcol(iris$Species)

Marlin-Na/TnT documentation built on Sept. 15, 2024, 5:27 a.m.