ClusterDendrogram: Cluster Dendrogram

View source: R/ClusterDendrogram.R

ClusterDendrogramR Documentation

Cluster Dendrogram

Description

Presents a dendrogram of a given tree using a colorsequence for the branches defined from the highest cluster size to the lowest cluster size.

Usage

ClusterDendrogram(TreeOrDendrogram, ClusterNo,

Colorsequence,main,xlab,ylab)

Arguments

TreeOrDendrogram

Either object of hcclust defining the tree, third list element of hierarchical cluster algorithms of this package

or

Object of class dendrogram, second list element of hierarchical cluster algorithms.

ClusterNo

k number of clusters for cutree.

Colorsequence

[1:k] character vector of colors. By default, the color sequence defined in DataVisualizations is used

main

title of plot

xlab

x label of plot

ylab

ylabel of plot

Details

Reqires the package dendextend to work correctly.

Value

In mode invisible:

[1:n] numerical vector defining the clustering of k clusters; this classification is the main output of the algorithm.

Author(s)

Michael Thrun

See Also

cutree, hclust

Examples

data(Lsun3D)
listofh=HierarchicalClustering(Lsun3D$Data,0,'SingleL')
Tree=listofh$Object
# Default colors:
#"magenta" "yellow"  "black"   "red"
ClusterDendrogram(Tree, 4,main='Single Linkage Clustering')

listofh=HierarchicalClustering(Lsun3D$Data,4)
ClusterCount(listofh$Cls)
#c1 is magenta, c2 is red, c3 is yellow, c4 is black
#because the order of the cluster sizes is
#c1,c3,c4,c2

FCPS documentation built on Oct. 3, 2026, 9:06 a.m.