Emphasize a certain age in Lexis grid

Description

Add a coloured rectangle to an existing Lexis grid to highlight a certain age in that Lexis grid.

Usage

1
lexis.age(lg, age, fill = "yellow", alpha = 0.5)

Arguments

lg,

an existing object originally created with lexis.grid().

age

numeric, set the age to highlight.

fill

character, set colour to fill the rectangle. Default is "yellow".

alpha

numeric, set alpha, the level of transparency for fill. Default is 0.5.

Details

Takes an existing Lexis grid and adds a coloured rectangle that highlights all triangles belonging to a certain age.

Value

A ggplot2 object.

Author(s)

Philipp Ottolinger

Examples

1
2
3
library(LexisPlotR)
lexis <- lexis.grid(year.start = 1900, year.end = 1905, age.start = 0, age.end = 5)
lexis <- lexis.age(lg = lexis, age = 3)