I have a data.frame that contains historical data during the day for several months. I would like to add a forecast at the end of this data.frame.
For example, I can run the following to create a simple data.frame example.
months <- c("2010-10-17","2010-10-18","2010-10-19","2010-10-20") revenue <- c(10000,11000,10500,9500) results <- data.frame(months,revenue)
And run this function to generate a forecast.
forecast(results$revenue)
I am stuck on how to add a date sequence for the rest of October and include the correct values ββfrom the forecast. I want to create something similar to this by adding 30 days of forecast to historical data.
> print(results) months revenue 1 2010-10-17 10000 2 2010-10-18 11000 3 2010-10-19 10500 4 2010-10-20 9500 5 2010-10-21 10250 6 2010-10-22 10250 7 2010-10-23 10250 8 2010-10-24 10250 9 2010-10-25 10250 10 2010-10-26 10250 11 2010-10-27 10250 12 2010-10-28 10250 13 2010-10-29 10250 14 2010-10-30 10250 15 2010-10-31 10250
Any help is appreciated. Thanks.
source share