[R] Subscript out of bounds

tobiasfa tobias.farnlycke at gmail.com
Tue Nov 24 19:00:59 CET 2009


Hi!

Trying to make a forecast, and get the following error message:

Error in NextMethod("[<-") : subscript out of bounds

The script is as follows:

> Forecast.A <- ts(matrix(NA, nrow=25, ncol = 1,
+ dimnames = list(c(), c("Outcome"))),
+ start = c(2006, 10), frequency = 12)
> for (i in 1:25) {
+ j <- i + 321
+ Data <- window(omxr, end = time(omxr)[j])
+ Result <- ets(Data, model = "MAM")
+ Forecast1 <- forecast(Result, 1)
+ Forecast.A[i, 2] <- window(omxr, start = time(omxr)[j +
+ 1], end = time(omxr)[j + 1])[[1]]
+ }

What am I doing wrong?

//Tobias
-- 
View this message in context: http://old.nabble.com/Subscript-out-of-bounds-tp26499901p26499901.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list