Question: R dendrogram by cluster
0
gravatar for oselm
24 months ago by
oselm30
oselm30 wrote:

Hi all,

I am using R to plot a dendrogram of a hierarchial clustering.

I have realised a hierarchical clustering of ~3000 elements. The plot of the corresponding tree is obviously super messy. These 3000 elements are clustered in 20 groups using the cutree function. What I want is to plot the tree by cluster (i.e. truncated at the nodes where each cluster originate labeled appropriately by cluster => a tree with 20 terminal leaves).

Thanks

O.

dendrogram R • 871 views
ADD COMMENTlink modified 16 months ago by Biostar ♦♦ 20 • written 24 months ago by oselm30
1
gravatar for Jake Warner
24 months ago by
Jake Warner680
Jake Warner680 wrote:

collapse_branch() in the package dendextend should do what you're looking for. https://cran.r-project.org/web/packages/dendextend/vignettes/introduction.html

ADD COMMENTlink written 24 months ago by Jake Warner680

Also take a look at the part about using dynamicTreeCut() and removing the labels, while printing a color bar. That might look nicer than cutting off all of the leaves.

ADD REPLYlink written 24 months ago by Jake Warner680
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2251 users visited in the last hour