I'm new to time series. While building a basic predictive model I ran into "> Error in xx - ff[1:n] : non-numeric argument to binary operator".
library(forecast) dj60 <- window(dowjones, end = 60) dj60.rwf.drift <- rwf(dj60, h = 18, drift = TRUE) dj60.od <- window(dowjones, start = 61) accuracy(dj60.od, dj60.rwf.drift)
Error in xx - ff[1:n] : non-numeric argument to binary operator
The preceding chain of commands works for another data set:
library(forecast) library(fpp2) vn_Melbourne_train1 <- window(visnights[, "QLDMetro"], end = c(2014, 4)) snaive_vn_Melbourne_train1 <- snaive(vn_Melbourne_train1, h = 4) vn_Melbourne_test1 <- window(visnights[, "QLDMetro"], start = c(2015, 1), end = c(2015, 4)) accuracy(snaive_vn_Melbourne_train1, vn_Melbourne_test1)
str() ed all of the objects and find them comparable.
Why does this error occur for one data set and not the other?