cluster_color: Generate Colors for Clustering Visualization

View source: R/tools.R

cluster_colorR Documentation

Generate Colors for Clustering Visualization

Description

Generates a color for each data point based on its clustering assignment, facilitating visual distinction of clusters in plots.

Usage

cluster_color(x)

Arguments

x

A clustering vector or a matrix. If a vector is provided, it represents the cluster assignments for each data point. If a matrix is provided, each row should represent a data point's membership across multiple clusters.

Value

A character vector of colors (in hexadecimal format) corresponding to the clustering assignments, suitable for use in plotting functions.

Examples

plot(iris[, 1:2], col = cluster_color(neokm(iris, 2, 0.2, 0.05)$cluster))

COveR documentation built on Oct. 30, 2024, 9:28 a.m.