1
$\begingroup$
library("tseries")
library("xts")
library("scales")
library(astsa, quietly=TRUE, warn.conflicts=FALSE)
library(ggplot2)
library(knitr)
library(printr)
library(plyr)
library(dplyr)
library(lubridate)
library(gridExtra)
library(reshape2)
library(TTR)
cc <- ts(Mobile_Payments,frequency = 12,start = c(2010,1))
cc
names(Mobile_Payments)
View(cc[,5])

plot.ts(cc[,5], main="Trend and Seasonal Monthly Data", ylab="Total Agent Cash in Cash Out (Volume Million")
x <- xts(Mobile_Payments$`Total Agent Cash in Cash Out (Volume Million)`,as.Date(Mobile_Payments$Dates),frequency = 12, start =c(2010,1),end =c(2021,2))
x
decomposex <- decompose(x,"multiplicative")
autoplot(decomposex)

Error in decompose(x, "multiplicative") : 
  time series has no or less than 2 periods
$\endgroup$
1
  • $\begingroup$ It looks like your data has less than 2 periods $\endgroup$ – WBM Apr 19 at 12:25