Analyzing Daily/Weekly data using ts in R

前端 未结 5 727
暗喜
暗喜 2020-11-30 01:22

I have just started playing with the ts class to analyze some time series data I have.

I am getting a sense that the ts class is not well s

5条回答
  •  忘掉有多难
    2020-11-30 01:50

    I suppose the problem with daily/weekly data is that both have leap units. Every fourth year has one additional 366 days and every fourth year has 53 weeks. Or has had since 1900. So the "frequency" is either not constant or a fraction. Otherwise ts should work just fine.

    Easiest way around weeks is to use the date of the start of the week. On unixlike systems you can also use ISO weeks, and there's also a package that implements them. Of course if your data is already in weeks, you only need these for labeling the graphs etc.

提交回复
热议问题