lexis_grid: Plot a Lexis grid

Description Usage Arguments Details Value Author(s) Examples

View source: R/lexis_grid.R

Description

lexis_grid() plots the basic Lexis grid.

Usage

1
2
lexis_grid(year_start, year_end, age_start, age_end, delta = 1,
  lwd = 0.3, force_equal = TRUE)

Arguments

year_start

integer, set the year the Lexis Diagram starts with.

year_end

integer, set the year the Lexis Diagram ends with.

age_start

integer, set the age the Lexis Diagram starts with.

age_end

integer, set the age the Lexis Diagram ends with.

delta

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

lwd

numeric, set the linewidth of the grid.

force_equal

logical, by default lexis.grid uses ggplot2::coord_fixed() to ensure isosceles trianlges. Set FALSE to allow for a non-isosceles appearance.

Details

The function determines the aspect ratio of the x- and y-axis to enforce isosceles triangles. The aspect ratio will not be effected by defining width and height in pdf() or other graphic devices.

Because the returned object is a ggplot2 graph, the overall appearence of the graph can be edited by adding themes() to the plot.

Value

A ggplot object.

Author(s)

Philipp Ottolinger

Examples

1
2
library(LexisPlotR)
lexis_grid(year_start = 1900, year_end = 1905, age_start = 0, age_end = 5)

Example output



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