Description Usage Arguments Details Value See Also Examples
View source: R/as_date_range.R
Convert standard labels for one-year periods
such as "2020", "2001", or "<2005" to
labels that give precise date ranges
such as "[2020-01-01, 2020-12-31]"
,
"[2001-10-01, 2002-10-01]"
,
or "(-Inf, 2005-06-30]"
.
1 | as_date_range_year(x, month_start = "Jan", label_year_start = TRUE)
|
x |
A vector of period or cohort labels. |
month_start |
An element of |
label_year_start |
Whether to label a period
by the calendar year at the beginning of the period
or the calendar year at the end. Defaults to |
The vector of period or cohort labels x
is typically
created using functions
format_period_year
or format_cohort_year
.
A factor the same length as x
.
as_date_range_multi
,
as_date_range_custom
,
as_date_range_quarter
,
as_date_range_month
1 2 3 4 5 6 7 | x <- c("<2010", "2010", "2011")
as_date_range_year(x)
as_date_range_year(x,
month_start = "Jul")
as_date_range_year(x,
month_start = "Jul",
label_year_start = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.