title: R vegdist(jaccard): how to include row name for clustering?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5755070/r-cluster-with-tanimoto-jaccard">R cluster with Tanimoto/Jaccard</a>  </p>
  </blockquote>
  
  
  
  <p>Input </p>
  
  <pre><code>genename  treatment1 treatment2 treatment3
  aaa       1          0          0
  bbb       0          1          1
  ccc       1          1          1
  ddd       0          0          0
  </code></pre>
  
  <p>By doing </p>
  
  <pre><code>d &lt;- vegdist(mytable, method = "jaccard")
  </code></pre>
  
  <p>from the package <code>vegan</code>. Error message as follows appears.</p>
  
  <pre><code>Error in rowSums(x, na.rm = TRUE) : 'x' must be numeric.
  </code></pre>
  
  <p>I type str(mytable), I see</p>
  
  <pre><code>'data.frame': xxx obs of xxx variables:
  $ aaa : int 1 0 0
  $ bbb : int 0 1 1
  $ ccc : int 1 1 1
  $ ddd : int 0 0 0 
  </code></pre>
  
  <p>As gene.name are needed to interprete the result, I want to keep the aaa, bbb, ccc and ddd.</p>
  
  <p>I also tried to remove the first column by the following command, however, either of these commands can solve the problem</p>
  
  <pre><code>rownames(mytable) &lt;- mytable[,1]
  mytable &lt;-mytable[,-1] 
  </code></pre>
  
  <p>Could you mind to teach me how to solve this problem? </p>