as_date_range_custom: Convert non-ambiguous labels for customised periods or...

Description Usage Arguments Details Value See Also Examples

View source: R/as_date_range.R

Description

Convert standard labels for periods or cohorts with varying widths (denominated in years), such as such as "<2020", "2020-2030", "2030-2032" to labels that give precise date ranges such as "(-Inf, 2020-06-30]", "[2020-07-01, 2030-06-30]", "[2030-07-01, , 2032-06-30]".

Usage

1
as_date_range_custom(x, month_start = "Jan")

Arguments

x

A vector of period or cohort labels.

month_start

An element of month.name, or month.abb. Each period or cohort starts on the first day of this month.

Details

The vector of period or cohort labels x is typically created using functions format_period_custom or format_cohort_custom.

Value

A factor the same length as x.

See Also

as_date_range_year, as_date_range_multi, as_date_range_quarter, as_date_range_month

Examples

1
2
3
x <- c("<2010", "2010-2012", "2012-2020")
as_date_range_custom(x)
as_date_range_custom(x, month_start = "Jul")

johnrbryant/demprep documentation built on Dec. 31, 2021, 11:58 a.m.