title: labeling row and col names when using dist() and as.matrix()
body: <p>I was wondering if there is a specific parameter to output a table with all the row names when using dist() and as.matrix(). Here's what I mean: </p>
  
  <pre><code>first=c('john', 'judy', 'jenny')
  second=c(3,6,9)
  third = c(2,4,6)
  df = data.frame(first,second,third)
  </code></pre>
  
  <p>I have this data frame called df:</p>
  
  <pre><code> first second third
  1  john      3     2
  2  judy      6     4
  3 jenny      9     6
  </code></pre>
  
  <p>Here's my desired output:</p>
  
  <pre><code>      john       judy   jenny
  john 0.000000 4.41588 8.831761
  judy 4.415880 0.00000 4.415880
  jenny 8.831761 4.41588 0.000000
  </code></pre>
  
  <p>This is my code: </p>
  
  <pre><code>df.dist=dist(df)
  df.dist=as.matrix(df.dist, labels=TRUE)
  df.dist
  </code></pre>
  
  <p>And Here's what R is giving me:</p>
  
  <pre><code>      1       2        3
  1 0.000000 4.41588 8.831761
  2 4.415880 0.00000 4.415880
  3 8.831761 4.41588 0.000000
  </code></pre>
  
  <p>I was wondering if there is a specific function or parameter that renames the columns when comparing different entries, or do we just need to code that ourselves?</p>
  
  <p>Another thing that I saw when I typed ?as.matrix is that there is a param called dimnames that lets you input list of names for cols and rows. But I don't know if this would be such a good idea since my dataset has about 100+ entries. </p>
  
  <p>Any help is deeply appreciated. Been stuck for a while. </p>