title: Correlation matrix in R from paired columns and coefficients
body: <p>I have a dataframe that has three variables: a, b, c.  The first two columns in the data set are the pairing of two of the variables for all possible combinations and the third is the correlation between them.  Shown below.  </p>
  
  <pre><code>&gt; var1 &lt;- c("a","a","b")
  &gt; var2 &lt;- c("b","c","c")
  &gt; r &lt;- c(.55,.25,.75)
  &gt; as.data.frame(cbind(var1,var2,r))
    var1 var2    r
  1    a    b  0.55
  2    a    c  0.25
  3    b    c  0.75
  </code></pre>
  
  <p>My question is whether it is possible to turn this dataframe containing the correlations into a correlation matrix object in R?  I also want to use some of R's plotting and graphing functions.</p>
  
  <p>Ultimately what I want is a matrix that looks like this</p>
  
  <pre><code>  a    b    c
  a 1   .55  .25
  
  b .55  1   .25
  
  c .25  .75  .75
  </code></pre>