0
$\begingroup$

I am having Sales data of 2018 and 19. I need to convert to time series. The data is not having daily sales

View(df)

Sales Date

75606 11/01/18

95620 16/01/18

55666 21/01/18

56270 29/01/18

45600 11/02/18

65620 18/02/18

50660 26/02/18

76200 10/03/18

75606 20/03/18

95620 27/03/18

55666 28/03/18

56270 29/03/18

45600 17/04/18

65620 24/04/18

50660 02/05/18

76200 16/05/18

And so on till 2019 Dec

Here the problem is if I convert to time series by using following code

tsn <- ts(df[,1], start =c(2018, 1), frequency=12)

It's considering only 1st 12 rows The output will be having 1st 12 values

So how to convert the whole data into time series. Should I aggregate monthly wise and convert that into time series or is there any way to do.

$\endgroup$
0
$\begingroup$

This is an example of multi-parallel-time-series.

Example shared on github MultiParallelTimeSeries, believe that will be helpful.

$\endgroup$
1
  • $\begingroup$ I need in R Language $\endgroup$ – user12490809 Mar 3 '20 at 11:25
0
$\begingroup$

Check the Date column type if it is a character you need to convert it into the date format and then change the dataframe to time series object using xts function from xts package.

library(lubridate) 
df$Date <- dmy(df$Date)
library(xts) #used to convert dataframe to ts object
tsdf<-xts(df,order.by=df$Date)
$\endgroup$
1
  • $\begingroup$ The data frame has converted to xts and zoo class. The data captured well for all the dates available. But I can't do ets arima models using this. How to proceed further $\endgroup$ – user12490809 Mar 4 '20 at 5:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.