title: Save R output as an object
body: <p>Suppose, I have fitted my data to a multivariate DCC model and do the forecasting to get mean returns. Below is my reproducible code.</p>
  
  <pre><code># load libraries
  library(rugarch)
  library(rmgarch)
  library(FinTS)
  library(tseries)
  library(fPortfolio)
  data(dji30retw)
  
  for (i in 1:2)
  { Dat.Initial = dji30retw[, 1:8, drop = FALSE]
    Dat &lt;- Dat.Initial[1:(1000+(i-1)), ] 
  
  #Fitting the data
  uspec = ugarchspec(mean.model = list(armaOrder = c(0,0)), variance.model = list(garchOrder = c(1,1), model = "sGARCH"), distribution.model = "norm")
  spec1 = dccspec(uspec = multispec( replicate(8, uspec)), dccOrder = c(1,1), distribution = "mvnorm")
  fit1 &lt;- list()
  fit1[[i]] = dccfit(spec1, data = Dat, out.sample = 120, fit.control = list(eval.se=T))
  
  #Out of sample forecasting
  dcc.focast &lt;- list()
  dcc.focast[[i]]=dccforecast(fit1[[i]], n.ahead = 1, n.roll = 0)
  #print(dcc.focast[[i]])
  
  #Mean returns 
  mean.focast &lt;- list()
  mean.focast[[i]] = fitted(dcc.focast[[i]] )
  print(mean.focast[[i]])
  
  #Var-Cov 
  covmat.focast[[i]]= rcov(dcc.focast[[i]])
  print(covmat.focast[[i]])
  }
  </code></pre>
  
  <p>R has given me the output in this form:-</p>
  
  <pre><code>, , 2004-01-30
  
               AA         AXP         BA         BAC           C         CAT         CVX          DD
  T+1 0.002903173 0.003462776 0.00295735 0.003485212 0.004442807 0.002986181 0.002069151 0.002367464
  
  , , 2004-02-06
  
           AA         AXP         BA         BAC           C       CAT        CVX          DD
  T+1 0.002933206 0.003511235 0.00300817 0.003510005 0.004436862 0.0029913 0.00205337 0.002382313
  </code></pre>
  
  <p>Is there any way we can save the output as one object/xts so it will look something like this?</p>
  
  <pre><code>               AA              AXP         ..........  DD
   30-01-2004    0.002903173   0.003462776   ........... 0.002367464
   06-02-2004    0.002933206   0.003511235   ........... 0.002382313
  </code></pre>
  
  <p>And another question, why is it if I type only 'mean.focast' , it gives me the following output?</p>
  
  <pre><code>[[1]]
  NULL
  
  [[2]]
  , , 2004-02-06
  
               AA         AXP         BA         BAC           C       CAT        CVX          DD
  T+1 0.002933206 0.003511235 0.00300817 0.003510005 0.004436862 0.0029913 0.00205337 0.002382313
  </code></pre>
  
  <p>Where is the value for [[1]]?</p>