lexis_age: Emphasize a certain age in Lexis grid

Description Usage Arguments Details Value Author(s) Examples

View source: R/lexis_age.R

Description

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

Usage

1
2
lexis_age(lg, age, delta = 1, fill = lexisplotr_colours()[1],
  alpha = 0.7)

Arguments

lg,

an existing object originally created with lexis_grid().

age

numeric, set the age to highlight.

delta

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

fill

character, set colour to fill the rectangle.

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)

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