0

I want draw a zig zag graph with proper date format while it show date like 2001.00,2001.01 etc

#import forecast library

library('forecast');

#prepare rawdata object for froecating

rawdata <- read.csv('bigDataSet6.csv',sep=',' ,head=TRUE);

attach(rawdata);

#attach data object in r
head(rawdata);

rawdata$Date <- as.Date(rawdata$Date);

#Using build in ts object

sts = ts(rawdata$Sale, start=2001, frequency=365);

#set Forecasting model

model.ets = ets(sts, model='ANA');


fc.ets = forecast(model.ets,12);

# plot graph
plot(fc.ets)

Please suggest if something is wrong in my code

user1317221_G
  • 15,087
  • 3
  • 52
  • 78
  • 1
    To start with there is a `)` missing right at the bottom of your code. –  Apr 10 '14 at 09:53
  • also perhaps you should give the output of a `dput(rawdata)` or at least part of `rawdata` as nobody but you has `bigDataSet6.csv` and therefore this is not [reproducible](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) . – user1317221_G Apr 10 '14 at 10:34
  • also you do not need the `""` around `forecast` in `library()` or any of the semicolons since you use new lines for each line of code – user1317221_G Apr 10 '14 at 10:38

0 Answers0