View source: R/ClusterDendrogram.R
ClusterDendrogram | R Documentation |
Presents a dendrogram of a given tree using a colorsequence for the branches defined from the highest cluster size to the lowest cluster size.
ClusterDendrogram(TreeOrDendrogram, ClusterNo,
Colorsequence,main='Name of Algorithm')
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 |
Reqires the package dendextend to work correctly.
In mode invisible:
[1:n] numerical vector defining the clustering of k clusters; this classification is the main output of the algorithm.
Michael Thrun
cutree
, hclust
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.