user2076038
user2076038

Reputation: 3

cluster attributes using hclust in R

I have a data set which is two dimensional data with column names as attributes and rows as items. A sample is given below:

       A1    A2   A3   A4   ....
Item1  0     1     0    0
Item2  0     0     0    1
Item3  1    1      0    0

....

I have used hclust (ward.D2 method) to create a cluster dendrogram in R. I can get the labels of all items in a cluster. How do i find out the list of attributes (A1 A2 etc) of the cluster so I can infer how those items came together?

The code which i have tried is :

d <- vegdist(data,method="jaccard")
fit <- hclust(d,method="ward.D2")
plot(fit)
hcd <- as.dendrogram(fit)
plot(cut(hcd,h=3)$upper)
labels(cut(hcd, h=3)$lower[[1]])

Upvotes: 0

Views: 875

Answers (1)

Has QUIT--Anony-Mousse
Has QUIT--Anony-Mousse

Reputation: 77485

Hierarchical clustering does not handle columns.

It operates on the distance matrix - there are no column labels anymore.

You may be looking for biclustering instead.

Upvotes: 2

Related Questions