lexis_cohort: Emphasize a certain cohort in a Lexis grid

Description Usage Arguments Details Author(s) Examples

View source: R/lexis_cohort.R

Description

Takes an existing Lexis grid and adds a coloured rectangle to highlight a certain cohort.

Usage

1
2
lexis_cohort(lg, cohort, delta = 1, fill = lexisplotr_colours()[3],
  alpha = 0.7)

Arguments

lg,

an existing object originally created with lexis_grid().

cohort

numeric, set the cohort to highlight.

delta

numeric, set the size of the age groups. Default is 1.

fill

character, set the colour of the rectangle.

alpha

numeric, set the level of transparency of the rectangle. Default is 0.5.

Details

Takes an existing Lexis grid and adds a coloured rectangle to the plot. The rectangle will highlight a certain cohort in the Lexis grid.

Author(s)

Philipp Ottolinger

Examples

1
2
3
library(LexisPlotR)
lg <- lexis_grid(year_start = 1900, year_end = 1905, age_start = 0, age_end = 5)
lexis_cohort(lg = lg, cohort = 1901)

ottlngr/LexisPlotR documentation built on Jan. 12, 2020, 6:57 p.m.