title: Eigenvalues for matrices in a for loop
body: <p>I need to calculate eigenvalues of a series of matrices and then save them in a separate file. My data has 5 columns and 10,000 rows. I use the following functions:</p>
  
  <pre><code>        R&lt;-NULL
  
      A &lt;- setwd("c:/location of the file on this computer")
      for(i in 0:1){
        X&lt;-read.table(file="Example.prn", skip=i*5, nrow=5)
        M &lt;- as.matrix(X)
        E=eigen(M, only.values = TRUE)
        R&lt;-rbind(R,E)}
        print(E)
      }
  </code></pre>
  
  <p>As an example I have used a data set with 10 rows and 5 columns. This gives me the following results:</p>
  
  <pre><code>$`values`
  [1]  1.350000e+02+0.000e+00i -4.000000e+00+0.000e+00i  4.365884e-15+2.395e-15i  4.365884e-15-2.395e-15i
  [5]  8.643810e-16+0.000e+00i
  
  $vectors
  NULL
  
  $`values`
  [1]  2.362320e+02+0.000000e+00i -4.960046e+01+1.258757e+01i -4.960046e+01-1.258757e+01i  9.689475e-01+0.000000e+00i
  [5]  1.104994e-14+0.000000e+00i
  
  $vectors
  NULL
  </code></pre>
  
  <p>I have three questions and I would really appreciate any help:</p>
  
  <ol>
  <li><p>I want to save the results in consecutive rows, such as:</p>
  
  <pre><code>Eigenvalue(1) Eigenvalue(3) Eigenvalue(5) Eigenvalue(7) Eigenvalue(9)
  Eigenvalue(2) Eigenvalue(4) Eigenvalue(6) Eigenvalue(8) Eigenvalue(10)
  </code></pre>
  
  <p>any thoughts?</p></li>
  <li><p>Also, I don't understand the eigenvalues in the output. They are not numbers. For example, one of them is 2.362320e+02+0.000000e+00i. My first though was that this is the sum of five determinants for a 5x5 matrix. However, "2.362320e+02+0.000000e+00i" seems to only have four numbers in it. Any thoughts? Doesn't <code>eigen</code>() function calculate the final values of eigenvalues?</p></li>
  <li><p>how can I save my outcome on an Excel file? I have used the following codes</p></li>
  </ol>
  
  <p>However, the result I get from the current codes are:</p>
  
  <pre><code>&gt; class(R)
  [1] "matrix"
  &gt; print(R)
    values    vectors   
  E Complex,5 NULL
  E Complex,5 NULL
  </code></pre>