# prepare data (from the forecast package)
library(forecast)
horizon <- 10
train <- wineind[-1 * (length(wineind)-horizon+1):length(wineind)]
test <- wineind[(length(wineind)-horizon+1):length(wineind)]
f <- frbe(ts(train, frequency=frequency(wineind)), h=horizon)
print(f)
print(test)
Run the code above in your browser using DataLab