title: How can I extract the matrix derived from a heatmap created with gplots after hierarchical clustering?
body: <p>I am making a heatmap, but I can't assign the result in a variable to check the result before plotting. Rstudio plot it automatically. I would like to get the list of rownames in the order of the heatmap. I'am not sure if this is possible. I'am using this code:</p>
  
  <pre><code>hm &lt;-    heatmap.2( assay(vsd)[ topVarGenes, ], scale="row", 
           trace="none", dendrogram="both", 
           col = colorRampPalette( rev(brewer.pal(9, "RdBu")) )(255),
           ColSideColors = c(Controle="gray", Col1.7G2="darkgreen", JG="blue", Mix="orange")[
             colData(vsd)$condition ] )
  </code></pre>