title: One-step ahead forecasts in R
body: <p>I'm using a <code>forecast</code> function in R many times with loop (12 months) for but I want to use accuracy to compare forecast for horizon time =12 and one-step ahead. My problem is how to store the results of 12 times to use it in accuracy.</p>
  
  <pre><code>for (i in 1:12) { 
    demfit &lt;- ets(Dem2) 
    f &lt;- forecast(demfit, 1) 
    Dem2[length(Dem2)+1] &lt;- f$mean[1] 
  } 
  accuracy(f,Test)
  </code></pre>
  
  <p>it computes accuracy only for the last point forecast 12</p>
  
  <p>But, I'm looking to this for the 12 forecats as this :</p>
  
  <pre><code>fit &lt;- ets(Dem2) 
  f1 &lt;- forecast(fit, 12) 
  accuracy(f1, Test)
  </code></pre>