title: Creating a symmetric matrix in R
body: <p>I have a matrix in R that is supposed to be symmetric, however, due to machine precision the matrix is never symmetric (the values differ by around 10^-16).  Since I know the matrix is symmetric I have been doing this so far to get around the problem:</p>
  
  <pre><code>s.diag = diag(s)
  s[lower.tri(s,diag=T)] = 0
  s = s + t(s) + diag(s.diag,S)
  </code></pre>
  
  <p>Is there a better one line command for this?</p>