title: Label R dendrogram branches with correct group number
body: <p>I am trying to draw a dendrogram so that the labels on the branches match the group number from my cluster analysis. Currently the branches are simply labelled from left to right in the order that they appear, not the actual group number. Here is my current R code and resulting dendrogram:</p>
  
  <pre><code>dst &lt;- dist(Model_Results,method="binary") 
  hca &lt;- hclust(dst)
  clust &lt;- cutree(hca,k=40)
  dend &lt;-as.dendrogram(hca)
  library(dendextend)
  dend1 &lt;- color_branches(dend, k = 40, groupLabels = TRUE)
  plot(dend1)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/VuEXr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VuEXr.png" alt="enter image description here"></a></p>
  
  <p>How can I change the labels to match to my actual group number?</p>