title: How to select all clusters, in a dendrogram, below a certain cutoff, in r
body: <p>I have a distance matrix, 227 columns by 227 rows called</p>
  
  <pre><code>"X9_resid_matrix"
  </code></pre>
  
  <p>This matrix represents 227 proteins and tells me how different each one is from each other. Therefore at the top right corner there is a zero because 1,1 represents the same protein therefore they are identical or zero different. The numbers range from 0 - 9.</p>
  
  <p>Then I used the following command to make a dendrogram: </p>
  
  <pre><code>"plot(hclust(as.dist(X9_resid_matrix)))"
  </code></pre>
  
  <p>The y axis goes ranges from zero to nine.</p>
  
  <p>I would like the computer to tell me only the clusters that are below a certain cutoff. </p>
  
  <p>Meaning if there are only 31 clusters that are zero distance, I would like a code that the computer will use to tell me what are those 31 clusters that are zero distance.</p>
  
  <p>The command:</p>
  
  <pre><code>cutree(hc, h=0)
  </code></pre>
  
  <p>does not seem to do that when I run it. </p>
  
  <p>For example:
  I have the following dendrogram:
  <a href="https://i.stack.imgur.com/l3hjX.jpg" rel="nofollow noreferrer">Click here to view</a></p>
  
  <p>I would like a command that cuts the dendrogram at a height of 1, and only displays 1 and 2.</p>