title: Sign of eigenvectors change depending on specification of the symmetric argument for symmetric matrices
body: <p>The signs of the eigenvectors in the <code>eigen</code> function change depending on the specification of the <code>symmetric</code> argument.  Consider the following example:</p>
  
  <pre><code>set.seed(1234)
  data &lt;- matrix(rnorm(200),nrow=100)
  cov.matrix &lt;- cov(data)
  vectors.1 &lt;- eigen(cov.matrix,symmetric=TRUE)$vectors
  vectors.2 &lt;- eigen(cov.matrix,symmetric=FALSE)$vectors
  #The second and third eigenvectors have opposite sign
  all(vectors.1 == vectors.2)
  FALSE
  </code></pre>
  
  <p>This also has implications for principal component analysis as the <code>princomp</code> function appears to calculate the eigenvectors for the covariance matrix using the <code>eigen</code> function with <code>symmetric</code> set to <code>TRUE</code>. </p>
  
  <pre><code>pca &lt;- princomp(data)
  #princomp uses vectors.1
  pca$loadings
  Loadings:
         Comp.1 Comp.2
   [1,] -0.366 -0.931
   [2,]  0.931 -0.366
  
                 Comp.1 Comp.2
  SS loadings       1.0    1.0
  Proportion Var    0.5    0.5
  Cumulative Var    0.5    1.0
  vectors.1
             [,1]       [,2]
  [1,] -0.3659208 -0.9306460
  [2,]  0.9306460 -0.3659208
  </code></pre>
  
  <p>Can someone please explain the source or reasoning behind the discrepancy?</p>