lexis_lifeline: Plot lifelines into a Lexis grid

Description Usage Arguments Details Value Author(s) Examples

View source: R/lexis_lifeline.R

Description

Add lifelines to an existing Lexis grid.

Usage

1
2
lexis_lifeline(lg, birth, entry = NA, exit = NA, lineends = FALSE,
  colour = lexisplotr_colours()[5], alpha = 1, lwd = 0.5)

Arguments

lg,

an existing object originally created with lexis_grid().

birth

character, set the birth date of an individual in format "YYYY-MM-DD".

entry

character, set the entry of an individual in format "YYYY-MM-DD". Optional.

exit

character, set the exit or death date of an individual in format "YYYY-MM-DD". Optional.

lineends

logical, if TRUE lineends will be marked. Default is FALSE.

colour

character, set the colour of the lifelines.

alpha

numeric, set the transparency of the lifelines. Default is 1 (no transparency).

lwd

numeric, set the linewidth of the lifelines. Default is 0.5.

Details

Takes an existing Lexis grid and adds lifelines to the grid. Input can be a single dates or dates from a vector.

Value

A ggplot2 object.

Author(s)

Philipp Ottolinger

Examples

1
2
3
4
lg <- lexis_grid(year_start = 1900, year_end = 1905, age_start = 0, age_end = 5)
lexis_lifeline(lg = lg, birth = "1901-09-23")
lexis_lifeline(lg = lg, birth = "1901-09-23", entry = "1902-04-01")
lexis_lifeline(lg = lg, birth = "1901-09-23", exit = "1904-10-31")

Example output



LexisPlotR documentation built on April 14, 2020, 7:38 p.m.