Learn R Programming

LexisPlotR (version 0.4.0)

lexis_age: 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

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.

Value

A ggplot2 object.

Details

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

Examples

Run this code
# NOT RUN {
library(LexisPlotR)
lexis <- lexis_grid(year_start = 1900, year_end = 1905, age_start = 0, age_end = 5)
lexis <- lexis_age(lg = lexis, age = 3)
# }

Run the code above in your browser using DataLab