title: Is there an easier way to extract combined fitted values and forecast values of an ARIMA in R?
body: <p>Simple question -- I want to extract the fitted values and mean forecast of an ARIMA as one single time series, using R.  Right now, I use this slow and cumbersome code:</p>
  
  <pre><code>x&lt;-auto.arima(y)
  z&lt;-forecast(x, 365)
  
  fitted&lt;-z$fitted
  mean&lt;-z$mean
  merged&lt;-merge.zoo(fitted, mean)
  merged$fitted[is.na(merged$fitted)]&lt;-0
  merged$mean[is.na(merged$mean)]&lt;-0
  
  finalforecast&lt;-merged$fitted+ merged$mean
  </code></pre>
  
  <p>There must be an esier way to do this, but looking at the documentation, I'm drawing a blank.  I really want to avoid the hassle of merging the time series, then dropping in zeroes (to fill the NAs), and then doing the addition.  I know I can create my own function, but I'd be surprised if there isn't something simple that's pre-baked. </p>
  
  <p>Thoughts?</p>