get_data_frq {dateutils} | R Documentation |
Get frequency of data based on missing observations
Description
Guess the frequency of a data series based on the pattern of missing observations
Usage
get_data_frq(x = NULL, dates)
Arguments
x |
data, potentially with missing observations |
dates |
corresponding dates in 'as.Date()' format |
Value
The frequency of the data
Examples
dates <- as.Date(c("2020-1-1", "2020-1-15", "2020-2-1",
"2020-2-15", "2020-3-1", "2020-3-15", "2020-4-1"))
get_data_frq(c(1,NA,2,NA,3,NA,4), dates) ## "month"
[Package dateutils version 0.1.5 Index]