title: R Dataframe make a new column combining row and column names
body: <p>I have a similarity matrix (SimMat) which I've converted to a dataframe by writing it out as .csv and re-reading it into the environment.</p>
  
  <pre><code>   A    B   C
  A  1   0.3 0.7   
  B 0.3   1  0.5   
  C 0.7  0.5  1  
  </code></pre>
  
  <p>I want to change this so that I have a dataframe detailing the unique comparisons and values like below:</p>
  
  <pre><code>Comp  Val
  A-A    1
  A-B   0.3
  A-C   0.7
  B-B    1 
  B-C   0.5
  C-C    1
  </code></pre>
  
  <p>Does anyone know how I might be able to do this?</p>