dend.plot: Visualization of Cluster Hierarchy using a Dendrogram

View source: R/dend.plot.R

dend.plotR Documentation

Visualization of Cluster Hierarchy using a Dendrogram

Description

The function dend.plot() visualizes the hierarchy of clusters using a dendrogram. The function also enables a user to mark the individual clusters with colors. The number of displayed clusters can be defined either by a user or by one of the five evaluation criteria.

Usage

dend.plot(
  x,
  clusters = "BIC",
  style = "greys",
  colorful = TRUE,
  clu.col = NA,
  main = "Dendrogram",
  ac = TRUE,
  ...
)

Arguments

x

An output of the nomclust() or nomprox() functions containing the dend component.

clusters

Either a numeric value or a character string with the name of the evaluation criterion expressing the number of displayed clusters in a dendrogram. The following evaluation criteria can be used: "AIC", "BIC", "BK", "PSFE" and "PSFM".

style

A character string or a vector of colors defines a graphical style of the produced plots. There are two predefined styles in the nomclust package, namely "greys" and "dark", but a custom color scheme can be set by a user as a vector of a length four.

colorful

A logical argument specifying if the output will be colorful or black and white.

clu.col

An optional vector of colors which allows a researcher to apply user-defined colors for displayed (marked) clusters in a dendrogram.

main

A character string with the chart title.

ac

A logical argument indicating if an agglomerative coefficient will be present in the output.

...

Other graphical arguments compatible with the generic plot() function.

Details

The function can be applied to a nomclust() or nomprox() output containing the dend component. This component is not available when the optimization process is used.

Value

The function returns a dendrogram describing the hierarchy of clusters that can help to identify the optimal number of clusters.

Author(s)

Jana Cibulkova and Zdenek Sulc.
Contact: jana.cibulkova@vse.cz

See Also

eval.plot, nomclust, nomprox.

Examples

# sample data
data(data20)

# creating an object with results of hierarchical clustering 
hca.object <- nomclust(data20, measure = "iof", eval = TRUE)

# a basic plot
dend.plot(hca.object)

# a dendrogram with color-coded clusters according to the BIC index
dend.plot(hca.object, clusters = "BIC", colorful = TRUE)

# using a dark style and specifying own colors in a solution with three clusters
dend.plot(hca.object, clusters = 3, style = "dark", clu.col = c("blue", "red", "green"))

# a black and white dendrogram
dend.plot(hca.object, clusters = 3, style = "dark", colorful = FALSE)


nomclust documentation built on Aug. 18, 2023, 5:06 p.m.

Related to dend.plot in nomclust...