title: Creating list of matrices in R
body: <pre><code>&gt; fact.cov &lt;- matrix(NA,ncol(fact.weight),ncol(fact.weight))
  
  &gt; for (row in 15:nrow(fact.weight)) {
      &gt;&gt; fact.cov[[row]] &lt;- var(fact.wealth.return[(row-1):row,])
  }
  </code></pre>
  
  <p>When I run this code I get the following error message:</p>
  
  <pre><code>Error in fact.cov[[row]] &lt;- var(fact.wealth.return[(row - 1):row, ]) : 
    more elements supplied than there are to replace
  </code></pre>
  
  <p>For each point in time (row), I need to create a covariance matrix. Do someone knows how to do this?</p>
  
  <p>Thank you in advance!</p>