Instead of using the forecast directly on the time series, we can create a model using exponential smoothing, Holts exponential smoothing, and Holt-Winter smoothing, and perform the forecast. Apart from this, the ARIMA model can also be used. Refer to the CRAN website for more details.