hopach clustering function orders the elements being clustered. This ordering can be used to rearrange the rows and columns in the corresponding distance matrix. A pseudo-color image of the ordered distance matrix will reveal the underlying patterns in the clustered data.The functions 'heat.colors', 'terrain.colors' and 'topo.colors' create heat-spectrum (red to white) and topographical color schemes suitable for displaying ordered data, with 'n' giving the number of colors desired.
dplot(dist, hopachobj, ord = "final", col = heat.colors(12), main = NULL,
xlab = NULL, ylab = NULL, labels = NULL, showclusters = TRUE, ...)distancematrix function.
The value in row 'j' and column 'i' is the distance between element 'i'
and element 'j'. The matrix must be symmetric. The distance metric should be
the same as that used in the hopach function.hopach function.hopach should be used for the plot. If ord="final", the ordering of elements in the final level of the hierarchical tree is used. If ord="cluster", the ordering from the level of the tree corresponding to the main clusters is used. In both cases, the elements from each cluster will be contiguous. If ord="final", then the medoid element will appear in the middle of each cluster. Else, the ordering depends on the value of ord passed to the hopach function. If ord="none", then the elements are plotted in the same order as in dist.image plotting functionvan der Laan, M.J. and Pollard, K.S. A new algorithm for hybrid hierarchical clustering with visualization and the bootstrap. Journal of Statistical Planning and Inference, 2003, 117, pp. 275-303.
http://www.stat.berkeley.edu/~laan/Research/Research_subpages/Papers/hopach.pdf
distancematrix, hopach, imagemydata<-matrix(rnorm(50),nrow=10)
mydist<-distancematrix(mydata,d="euclid")
clustresult<-hopach(mydata,dmat=mydist)
dplot(mydist,clustresult,showclusters=FALSE)
dplot(mydist,clustresult,col=topo.colors(15))
Run the code above in your browser using DataLab