Time series analysis:
1. Describe the time series
2. Use the previous results to predict ts is the English abbreviation of time series.
You can use the Sys.Date() function to view the current system time.
Use the seq function to create continuous time points
eg
seq(as.Date("2020-01-01"),as.Date("2020-04-07"),by=3)
The ts function generates a time series, which can easily convert a vector into a time series
eg
sales=round(runif(50,min = 50,max = 100))
sales
ts(sales,start = c(2016,6),end = c(2020,7),frequency = 1)按年
ts(sales,start = c(2016,6),end = c(2020,7),frequency = 4)按季度
ts(sales,start = c(2016,6),end = c(2020,7),frequency = 12)按月份