title: How to hierarchically cluster a data matrix in R?
body: <p>I am trying to cluster a data matrix produced from scientific data. I know how I want the clustering done, but am not sure how to accomplish this feat in R. </p>
  
  <p>Here is what the data looks like:</p>
  
  <pre><code>            A1     A2     A3     B1     B2     B3     C1     C2     C3
  sample1      1      9     10      2      1     29      2      5     44
  sample2      8      1     82      2      8      2      8      2     28
  sample3      9      9     19      2      8      1      7      2     27
  </code></pre>
  
  <p>Please consider A1,A2,A3 to be three replicates of a single treatment, and likewise with B and C. Sample1 are different tested variables. So, I want to hierarchically cluster this matrix in order to see the over all differences between the columns, specifically I will be making a dendrogram (tree) to observe the relatedness of the columns.</p>
  
  <p>Does anyone know how to appropriately cluster something like this? I tried doing this with this:</p>
  
  <pre><code>raw.data &lt;- read.delim("test.txt",header=FALSE,stringsAsFactors=FALSE)
  dist.mat&lt;-vegdist(raw.data,method="jaccard")
  clust.res&lt;-hclust(dist.mat)
  plot(clust.res)
  </code></pre>
  
  <p>...However, this resulted in a tree with branches for each sample variable, instead of each column. Thanks for any suggestions!</p>