View source: R/colorDendClass.R
colorDendClass | R Documentation |
Makes the plot of the dendrogram, visualizing the class label information with different colors of dendrogram edges.
colorDendClass(dend, class)
dend |
the clustering dendrogram of the analyzed dataset. |
class |
a vector of length n, which stores the class labels of the dataset objects. |
Makes the plot of the dendrogram, visualizing the class label information with different colors of dendrogram edges.
Natalia Novoselova,Frank Klawonn,Junxi wang
Maintainer: Natalia Novoselova <novos65@mail.ru>
Z. Bar-Joseph, D.K. Gifford, and T.S. Jaakkola. Fast optimal leaf ordering for hierarchical clustering. Bioinformatics, 17:22-29, 2001.
RearrangeJoseph
, OrderingJoseph
data(leukemia) rownames(leukemia)=leukemia[,1] leukemia=leukemia[,-1] matr=leukemia[,-101] class=leukemia[,101] matr=as.matrix(matr) dist=dist(matr) hc <- hclust(dist) dend=as.dendrogram(hc) label=unique(class) Rowcolor=rainbow(length(label)) rc=matrix(0,length(class),1) for (j in 1:length(label)) { index=which(class==label[j]) rc[index]=Rowcolor[j] } colorDendClass(dend,rc[hc$order])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.