I have a data frame which I am trying to cluster. I am using hclust
right now. In my data frame, there is a FLAG
column which I would like to color the dendrogram by. By the resulting picture, I am trying to figure out similarities among various FLAG
categories. My data frame looks something like this:
FLAG ColA ColB ColC ColD
I am clustering on colA
, colB
, colC
and colD
. I would like to cluster these and color them according to FLAG
categories. Ex - color red if 1, blue if 0 (I have only two categories). Right now I am using the vanilla version of cluster plotting.
hc<-hclust(dist(data[2:5]),method='complete')
plot(hc)
Any help in this regard would be highly appreciated.