load required libraries
library(forecast)
Registered S3 method overwritten by 'quantmod':
method from
as.zoo.data.frame zoo
library(tseries)
library(lubridate)
Attaching package: 'lubridate'
The following objects are masked from 'package:base':
date, intersect, setdiff, union
library(ggplot2)
sample sales data
data<-c(100,110,120,115,130,140,150,145,160,170,180,175)
dates<-seq(as.Date("2024-01-01"),by="month",length.out=12)
create time series object
ts_data<-ts(data,start = c(2024,1),frequency = 12)
plot the data to visualize the trend
autoplot(ts_data)+labs(title="monthly sales data")

forecast with ARIMA
forecast_model<-auto.arima(ts_data)
forecast_values<-forecast(forecast_model,h=6)
plot forecast series
autoplot(forecast_values)+labs(title="sales forecast")

From the plot above the forecasted sales for the next 6 months is
expected to increase.