title: I need to make my forecast function to output a vector in R
body: <p>I write the below <code>r</code> code to forecast to a future time. I initially divide the data set into <code>train</code> and <code>test</code> set so I can cross-validate the model used. I then write to <code>forecast</code> the <code>train</code> set to the length of <code>test</code> set.</p>
  
  <pre><code># construct a time series data
  n &lt;- 50
  phi &lt;- 0.5
  set.seed(1)
  wn &lt;- rnorm(n, mean=0, sd=1)
  ar1 &lt;- sqrt((wn[1])^2/(1-phi^2))
  for(i in 2:n){
    ar1[i] &lt;- ar1[i - 1] * phi + wn[i]
  }
  library(forecast) # load `forecast` package
  
  train &lt;- head(ar1, round(length(ar1) * 0.6)) # Divide the time series into `train` set
  h &lt;- length(ar1) - length(train)
  test &lt;- tail(ar1, h) # Divide the time series into `test` set
  model &lt;- auto.arima(train) # obtain optimual model
  future &lt;- forecast(test, model=model,h=h) # forecast the `test` set into 20 times ahead
  future
  </code></pre>
  
  <p><strong>What I have</strong></p>
  
  <p>The object <code>future</code> is printed out as:</p>
  
  <pre><code>#     Point Forecast   Lo 80    Hi 80     Lo 95    Hi 95
  #21   4.431517e-01 -0.7445769 1.630880 -1.373322 2.259626
  #22   1.942684e-01 -1.1025747 1.491112 -1.789082 2.177619
  #23   8.516321e-02 -1.2316138 1.401940 -1.928673 2.099000
  #24   3.733377e-02 -1.2832396 1.357907 -1.982309 2.056976
  #25   1.636634e-02 -1.3049353 1.337668 -2.004390 2.037123
  #26   7.174662e-03 -1.3142669 1.328616 -2.013796 2.028145
  #27   3.145222e-03 -1.3183232 1.324614 -2.017866 2.024157
  #28   1.378799e-03 -1.3200948 1.322852 -2.019641 2.022398
  #29   6.044368e-04 -1.3208702 1.322079 -2.020417 2.021625
  #30   2.649724e-04 -1.3212098 1.321740 -2.020756 2.021286
  #31   1.161584e-04 -1.3213587 1.321591 -2.020905 2.021138
  #32   5.092140e-05 -1.3214239 1.321526 -2.020970 2.021072
  #33   2.232288e-05 -1.3214525 1.321497 -2.020999 2.021044
  #34   9.785882e-06 -1.3214651 1.321485 -2.021012 2.021031
  #35   4.289926e-06 -1.3214706 1.321479 -2.021017 2.021026
  #36   1.880614e-06 -1.3214730 1.321477 -2.021020 2.021023
  #37   8.244217e-07 -1.3214740 1.321476 -2.021021 2.021022
  #38   3.614092e-07 -1.3214745 1.321475 -2.021021 2.021022
  #39   1.584342e-07 -1.3214747 1.321475 -2.021021 2.021022
  #40   6.945425e-08 -1.3214748 1.321475 -2.021021 2.021021
  </code></pre>
  
  <p><strong>What I want</strong></p>
  
  <p>I want the object <code>future</code> to print out as a vector of a point estimate alone without any interval.</p>
  
  <pre><code>#4.431517,  1.942684, ...,6.945425
  </code></pre>
  
  <p>and should be a class of vector</p>