get_data_frq: Get frequency of data based on missing observations

Description Usage Arguments Value Examples

Description

Guess the frequency of a data series based on the pattern of missing observations

Usage

1
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

1
2
3
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"

dateutils documentation built on Nov. 10, 2021, 5:09 p.m.