Step 1 reads the data, and in step 2, the time series object ts is created. For more details, refer to Using time series objects recipe earlier in this chapter.
In step 3, the HoltWinters function is used to smooth the data.
In step 4, the resulting HoltWinters object is plotted. It shows the original time series as well as the smoothed values.
Step 5 shows the functions available to extract information from the Holt-Winters model object.
In step 6, the predict.HoltWinters function is used to predict future values. The colored bands show the 85% and 95% confidence intervals.