0

I have a set of data that spans 6 years with data points 3 times of each year. I am trying to create an object to feed into R's forecasting package but I need the data to appear like the following but am not able to figure out the frequency or deltat logic on the ts().

2002 23 24 19
2003 03 23 20
2004 18 18 19
2005 12 21 29

Thanks

  • Please provide a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) showing the structure your raw data, and your code (that's not "working") so that others can reproduce your steps, errors etc and answer your question. Cheers! – shekeine Oct 22 '14 at 19:13

1 Answers1

1

You need to specify frequency=3 as a parameter to ts():

library(forecast)
foo <- ts(c(23,24,19,03,23,20,18,18,19,12,21,29),
    frequency=3,start=2002)
model <- ets(foo)
plot(forecast(model,h=6))

forecast

Stephan Kolassa
  • 7,953
  • 2
  • 28
  • 48