So I'm trying to apply an exponential smoothing model to each column in a data frame called 'cities'. I have used apply to identify the data frame, go by columns, and I thought to run the model. However, when I try to do so, it tells me that I need to specify data for the exponential smoothing model...I thought I already had by putting it in the apply loop.
apply(x=cities,2,FUN=HoltWinters(x=x,gamma=FALSE))
Also, eventually I'd like to predict the next 4 periods using the HW model developed using forecast.predict. Do I need to use a different loop or can I combine it all in this one?