In R I use heatmap.2 (from the gplots package) to cluster and visualize some data.
I would like to access the column dendrogram (clusters) for further manipulation of my data.
For example:
x = matrix(runif(250), nrow= 50) h = heatmap.2(x)
h$colDendrogram
'dendrogram' with 2 branches and 5 members total, at height 3.033438
Is there a way to know the indexes of the column belonging to the first branch and those belonging to the second (in an automatic fashion ; of course in this simple case I might just look at labels on the x axis).
Further how can I access the other sub branches?