How to create “NA” for missing data in a time series

后端 未结 4 1262
忘了有多久
忘了有多久 2021-01-30 09:54

I have several files of data that look like this:

X code year month day pp  
1 4515 1953     6   1  0  
2 4515 1953     6   2  0  
3 4515 1953     6   3  0  
4         


        
4条回答
  •  梦谈多话
    2021-01-30 10:35

    In the zoo package "regular" means that the series is equally spaced except possibly for some missing entries. The zooreg class in the zoo package is specifically for that type of series. Note that the set of all regular series includes the set of all equally spaced series but is strictly larger.

    The is.regular function checks whether a given series is regular. That is, is the series amenable to making it equally spaced if one inserted NAs for the missing entries?

    Regarding your last question, its a FAQ. See FAQ #13 in the zoo FAQ available from the zoo CRAN page or from within R via:

    vignette("zoo-faq") 
    

    Also in FAQ #13 there is some illustrative code.

提交回复
热议问题