0

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!

  • Welcome to SO! Please add some data to make your code creates the issue you report here. Try to read [this](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – s__ Oct 27 '21 at 15:48

0 Answers0