VOOZH about

URL: https://www.geeksforgeeks.org/r-language/find-eigenvalues-and-eigenvectors-of-a-matrix-in-r-programming-eigen-function/

⇱ Find Eigenvalues and Eigenvectors of a Matrix in R Programming - eigen() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Find Eigenvalues and Eigenvectors of a Matrix in R Programming - eigen() Function

Last Updated : 15 Jul, 2025
eigen() function in R Language is used to calculate eigenvalues and eigenvectors of a matrix. Eigenvalue is the factor by which a eigenvector is scaled.
Syntax: eigen(x) Parameters: x: Matrix
Example 1: Output:
The 3x3 matrix:
 [, 1] [, 2] [, 3]
[1, ] 1 4 7
[2, ] 2 5 8
[3, ] 3 6 9
eigen() decomposition
$values
[1] 1.611684e+01 -1.116844e+00 -5.700691e-16

$vectors
 [, 1] [, 2] [, 3]
[1, ] -0.4645473 -0.8829060 0.4082483
[2, ] -0.5707955 -0.2395204 -0.8164966
[3, ] -0.6770438 0.4038651 0.4082483
Example 2: Output:
 [, 1] [, 2]
[1, ] 2 5
[2, ] 3 1
eigen() decomposition
$values
[1] 5.405125 -2.405125

$vectors
 [, 1] [, 2]
[1, ] 0.8265324 -0.7503320
[2, ] 0.5628892 0.6610612
Comment
Article Tags:

Explore