Why do prcomp() and eigen(cov()) in R return different signs of PCA eigenvectors? I understand the sign of the eigen vectors / PCA rotations can be positive or negative (see here or here). 
But I am curious why the following two approaches yield different results, from numerical method perspective?
> d = iris[,1:2]
> pca = prcomp(d)
> r = eigen(cov(d))
> r$vectors
            [,1]        [,2]
[1,] -0.99640834 -0.08467831
[2,]  0.08467831 -0.99640834
> pca$rotation
                     PC1        PC2
Sepal.Length  0.99640834 0.08467831
Sepal.Width  -0.08467831 0.99640834

 A: Looking at the code, stats:::prcomp.default uses singular value decomposition at its core, rather than eigendecomposition of the variance-covariance matrix.
In general, the computed signs of eigenvectors can be very sensitive to small computational differences: according to Brian Ripley on R-help in 2003,

using different compilers on the same machine and the 
  same version of R may give different signs for the eigenvectors.  The 
  moral is, don't rely on the signs of eigenvectors!  (This is on the help 
  page.)

That is, it's not just prcomp (SVD) vs. eigen; the results could differ for eigen across operating systems, compilers, possibly even floating-point hardware ...
A: I know this is an old topic, but it's happened to me recently and I have found a solution that seems to work. I guess is due the internals of prcomp and eigen as pointed out in a previous comment, but if you want eigen to produce the same eigenvectors as prcomp it seems using the flag symmetric = FALSE does the trick:
> d = iris[,1:2]
> pca = prcomp(d)
> r = eigen(cov(d), symmetric = FALSE)
> r$vectors
            [,1]       [,2]
[1,]  0.99640834 0.08467831
[2,] -0.08467831 0.99640834
> pca$rotation
                     PC1        PC2
Sepal.Length  0.99640834 0.08467831
Sepal.Width  -0.08467831 0.99640834
> 

I hope this is useful for someone else.
