Analyzing Daily/Weekly data using ts in R

前端 未结 5 717
暗喜
暗喜 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 02:07

    zoo works well with daily data. For example, if you had a daily series of streamflows in a vector Q and with corresponding date stamps D (created using as.Date(), for example).

    Q.z <- zoo(Q, order.by=D) 
    

    will create an object that will plot nicely and you can use functions such as window() to extract single years e.g.

    window(Q.z, start = as.Date('2000-01-01'), end=as.Date('2000-31-12')
    

    Check the zoo package for more information.

提交回复
热议问题