please see previous question details relating test data , commands used create dendrogram: using r cluster based on euclidean distance , complete linkage metric, many vectors?
here quick summary of commands make dendrogram:
un_exprs <- as.matrix(read.table("sample.txt", header=true, sep = "\t", row.names = 1, as.is=true)) exprs <- t(un_exprs) eucl_dist=dist(exprs,method = 'euclidean') hie_clust=hclust(eucl_dist, method = 'complete')\ dend <- as.dendrogram(hie_clust) plot(dend) this makes nice dengrogram plot. however, lets dendrogram has 2 clusters... want text list of each element belonging each of 2 clusters. i'm assuming trivial, don't have enough experience r intuitive. thanks!
you can compute hclust return stats::cutree
cutree(hie_clust,k=2)
Comments
Post a Comment