To use ggplot to work with time series, I need to take a bunch of predicted values and put them in the data file along with the corresponding dates.
I used the following code to declare my starting vector a ts
name <- ts(name, frequency=12, start=c(2007,1))
Then I fit the model using
fit <- auto.arima (name)
and prediction and prediction intervals, as shown below.
name.for <- forecast(fit, 15)
name.for.low <- name.for$lower[,2]
name.for.up <- name.for$upper[,2]
I know that I hope to make a date vector that starts where the time loop announced above ends and goes forward n months
I think I can use something like:
seq(as.Date('X'), length.out=n, by='1 month')
However, I want X to be dynamic and calculated from the time series vector above