Hello, I hope you can help me. I used the R hclust function (method 'average') to cluster a matrix, and I want to: 1. plot the dendrogram/heatmap 2. visualize the clustering information (essentially the number and composition of the clusters). I plot the dendrogram converting the hclust result with 'as.dendrogram', and I use the heatmap function to create the heatmap. In these steps I don't have to specify any pre-defined number of clusters (k) nor the heigth where to cut (h). And I don't grasp if they are set by default to a certain value. To visualize data I use 'write.hclust', which needs one of the 2 parameters, either k or h. I can set them, but of course the separation into clusters that I impose is different from the dendrogram/heatmap plot. I don't understand how to aling the graphyc and the text results. Could you please suggest me some solutions? Thanks Federica
Hierarchical cluster analysis merges the two closest sequences in an iterative manner, until only one cluster remains. This immediately suggests that, if you want seprate clusters, you need to set a cutoff when the algorithm should stop merging. That's where the
k parameters come in.
If your clusters are clear-cut in the Heatmap, you can e.g. use the number you see in there for the cluster number.