2

I have the following code that perform hiearchical clustering and plot them in heatmap.

set.seed(538)
# generate data
y <- matrix(rnorm(50), 10, 5, dimnames=list(paste("g", 1:10, sep=""),
paste("t", 1:5, sep="")))
# the actual data is much larger that the above

# perform hiearchical clustering and plot heatmap
test <- heatmap.2(y)

What I want to do is to print the cluster member from each hierarchy of in the plot. I'm not sure what's the good way to do it.

I tried this:

cutree(as.hclust(test$rowDendrogram), 1:dim(y)[1])

But having problem in interpreting the result. What's the meaning of each value in the matrix? For example g9-9=8 . What does 8 mean here?

    1 2 3 4 5 6 7 8 9 10
g1  1 1 1 1 1 1 1 1 1  1
g2  1 2 2 2 2 2 2 2 2  2
g3  1 2 2 3 3 3 3 3 3  3
g4  1 2 2 2 2 2 2 2 2  4
g5  1 1 1 1 1 1 1 4 4  5
g6  1 2 3 4 4 4 4 5 5  6
g7  1 2 2 2 2 5 5 6 6  7
g8  1 2 3 4 5 6 6 7 7  8
g9  1 2 3 4 4 4 7 8 8  9
g10 1 2 3 4 5 6 6 7 9 10

Your expert advice will be greatly appreciated.

4

1 回答 1

4

j告诉您g如果您想要确切的组,您的 s 应该如何分组j

110不是很有用,但也许列2是一个很好的例子。它告诉您,如果您想要两个组,那么它们将是:

group1: {g1, g5}
group2: {g2, g3, g4, g6, g7, g8, g9, g10}
于 2013-08-22T03:04:16.383 回答