eigen is a base R function that returns eigenvectors and eigenvalues for a given matrix.
I just found that it can be not robust for the symmetric matrices when you specify this explicitly using symmetric=TRUE. I show the issue below. Are there libraries that fix the issue and find correct eigenvectors using information about symmetry?
Example
Let us firstly find an eigen vector for a symmetric matrix without specifying the symmetry.
set.seed(1)
I = 10; A = matrix( rnorm(I*I), ncol = I );
## make the matrix symmetric
A[lower.tri(A)] = A[upper.tri(A)]
ev = eigen(A, symmetric=F); ve = ev$vectors; va = ev$values;
Test the result taking the difference between A applied to its eigenvector and eigenvector scaled by the eigenvalue. That must be a zero vector. Hence, the sum of its elements must be zero:
sum(A %*% ve[,1] - va[1]*ve[,1] )
-3.663736e-15+0i
Now, let's do the same specifying symmetry:
ev = eigen(A, symmetric=TRUE); ve = ev$vectors; va = ev$values;
sum(A %*% ve[,1] - va[1]*ve[,1] )
-0.3534416
As it was mentioned in the answers, my example was bad since the matrix was not symmetric. The approach I used for the example
A[lower.tri(A)] = A[upper.tri(A)]
will actually give an asymmetric matrix. The more accurate way of getting a symmetric matrix would be
A[lower.tri(A)] = t(A)[lower.tri(A)]
or
A <- A+t(A)