plot_date_to_triangle_year: Depict the Lexis triangles created by function...

Description Usage Arguments Details Examples

View source: R/plot_date_to_triangle.R

Description

Create plot illustrating how function date_to_triangle_year works.

Usage

1
2
3
4
5
6
7
plot_date_to_triangle_year(
  date,
  dob,
  month_start = "Jan",
  label_year_start = TRUE,
  show_months = FALSE
)

Arguments

date

Dates of events.

dob

Dates of birth.

month_start

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

show_months

Whether to include vertical lines showing boundaries between months. Defaults to FALSE.

Details

plot_date_to_triangle_year is typically used for instruction or documentation, rather than for actual data analysis.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
plot_date_to_triangle_year(date = c("2024-05-27",
                                    "2024-11-09"),
                           dob = c("2020-03-13",
                                   "2021-08-24"))

## start on 1 July, rather than 1 January
plot_date_to_triangle_year(date = c("2024-05-27",
                                    "2024-11-09"),
                           dob = c("2020-03-13",
                                   "2021-08-24"),
                           month_start = "July")

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