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='Name of Algorithm')

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, per default the colorsquence defined in the DataVisualizations is used

main

Title 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
#given colors are per default:
#"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. 19, 2023, 5:06 p.m.