pal.cluster: Show a palette with hierarchical clustering

View source: R/tools.R

pal.clusterR Documentation

Show a palette with hierarchical clustering

Description

The palette colors are converted to LUV coordinates before clustering. (RGB coordinates are available, but not recommended.)

Usage

pal.cluster(pal, n = 50, type = "LUV", main = "")

Arguments

pal

A palette function or a vector of colors.

n

The number of colors to display for palette functions.

type

Either "LUV" (default) or "RGB".

main

Title to display at the top of the test image

Details

What to look for:

Colors that are visually similar tend to be clustered together.

Value

None

Author(s)

Kevin Wright

References

None

Examples

pal.cluster(alphabet(), main="alphabet")
pal.cluster(glasbey, main="glasbey") # two royal blues are very similar
pal.cluster(kelly, main="kelly") # two black-ish colors are very similar
# pal.cluster(watlington, main="watlington")
# pal.cluster(coolwarm(15), main="coolwarm") # curiously, grey clusters with blue


kwstat/pals documentation built on Feb. 4, 2024, 10:36 a.m.