Within the "forecast" library, I am trying to run the following code:
regModel <- tslm(train.ts ~ trend + season)
testing.ts.predict <- forecast(regModel, h = nTest)
I get the following error:
Error in [.default(X, , piv, drop = FALSE) : incorrect number of dimensions
This is especially unusual because at times when I run the code it works, then when I close the program and start it up again, it stops running.
I can provide more of the code above the portion highlighted in my question, but it runs smoothly (it also runs for other students in my class).
Wondering if anyone can help with this?
Thanks so much!