date_to_period_month: Convert dates to one-month periods

Description Usage Arguments Value See Also Examples

View source: R/date_to_period.R

Description

Assign dates to one-month periods.

Usage

1

Arguments

date

Dates of events or measurements. A vector of class Date, or a vector than can be coerced to class Date via function as.Date.

Value

A factor with the same length as date.

See Also

The output from date_to_period_month is often processed further using format_period_month.

Other functions for creating periods from dates are date_to_period_year and and date_to_period_quarter.

Other functions for creating one-month units from dates are date_to_age_month, date_to_cohort_month, and date_to_triangle_month. The interface for date_to_period_month is identical to that of date_to_cohort_month.

Examples

1
2
3
date_to_period_month(date = c("2024-03-27",
                              "2020-01-03",
                              "2022-11-09"))

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