date_to_triangle_month: Convert dates to one-month Lexis triangles

Description Usage Arguments Details Value See Also Examples

View source: R/date_to_triangle.R

Description

Use dates of events and dates of birth to create one-month Lexis triangles.

Usage

1

Arguments

date

Dates of events. A vector of class Date, or a vector that can be coerced to class Date using function as.Date.

dob

Dates of birth. A vector of class Date, or a vector that can be coerced to class Date using function as.Date.

Details

See vignette("demprep") for the definition of Lexis triangles.

date and dob must have the same length, unless one of them has length 1, in which case the length-1 argument is recycled.

Value

A character vector with the same length as date.

See Also

The output from date_to_triangle_month is often processed further using function format_triangle_month.

Other functions for creating triangles from dates are date_to_triangle_year and date_to_triangle_quarter.

Other functions for creating one-month units from dates are date_to_age_month. date_to_period_month, and date_to_cohort_month.

Examples

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

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