color_hclust: color_hclust

View source: R/color_hclust.R

color_hclustR Documentation

color_hclust

Description

Determines colors for x based on stats::hclust. x is normalized according normalize.

Usage

color_hclust(
  x,
  normalize = 1,
  ncol = 2,
  colpal = grDevices::hcl.colors,
  dist = "euclidean",
  na.action = stats::na.pass,
  ...
)

Arguments

x

a numeric matrix, data frame or "dist" object.

normalize

integer: normalization method (default: 1)

  • 0: no rescaling

  • 1: (x-min(x))/(max(x)-min(x))

  • 2: (x-mean(x))/sd(x)

ncol

integer: maximal number colors

colpal

color palette: a function which generates "ncol" colors with "colpal(ncol)" (default: grDevices::hcl.colors)

dist

the distance measure to be used. This must be one of "euclidean", "maximum", "manhattan", "canberra" or "binary"(default: euclidean)

na.action

a function which indicates what should happen when the data contain NAs (default: na.pass)

...

further parameters given to stats::hclust

Value

a color vector

Examples

color_hclust(iris[,-5], ncol=6)

sigbertklinke/smvgraph documentation built on Dec. 10, 2022, 9:13 a.m.