plot_date_to_age_year: Depict the intervals created by function 'date_to_age_year'

Description Usage Arguments Details Examples

View source: R/plot_date_to_age.R

Description

Create a plot illustrating how function date_to_age_year works.

Usage

1
plot_date_to_age_year(date, dob, show_months = FALSE)

Arguments

date

Dates of events or measurements. 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.

show_months

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

Details

plot_date_to_age_year is typically used for learning or documentation, rather than for actual data analysis.

Examples

1
2
3
4
5
6
7
8
9
plot_date_to_age_year(date = c("2002-11-09",
                               "2004-04-27"),
                      dob = c("2000-07-13",
                              "2001-03-21"))
plot_date_to_age_year(date = c("2002-11-09",
                               "2004-04-27"),
                      dob = c("2000-07-13",
                              "2001-03-21"),
                      show_months = TRUE)

bayesiandemography/demprep documentation built on Dec. 28, 2021, 8:47 a.m.