lexis_polygon: Plot a polygon inside a Lexis grid Takes an existing Lexis...

Description Usage Arguments Details Author(s) Examples

View source: R/lexis_polygon.R

Description

Plot a polygon inside a Lexis grid Takes an existing Lexis grid and adds a polygon.

Usage

1
2
lexis_polygon(lg, x, y, group = 1, fill = lexisplotr_colours()[4],
  alpha = 0.7)

Arguments

lg,

an existing object originally created with lexis_grid().

x,

vector describing the x coordinates of the polygon. Format: YYYY-MM-DD.

y,

vector describing the y coordinates of the polygon

group,

vector describing the groups of coordinates.

fill

character, fill colour of the polygon.

alpha

numeric, transparency of the fill colour. Default: 0.7.

Details

The function can be used to plot a polygon inside a Lexis grid.

Author(s)

Philipp Ottolinger

Examples

1
2
3
4
5
6
## Not run: 
library(LexisPlotR)
lg <- lexis_grid(year_start = 1900, year_end = 1905, age_start = 0, age_end = 5)
lexis_polygon(lg, x = c("1901-06-30", "1904-06-30", "1904-06-30", "1901-06-30"), y = c(2,2,4,4))

## End(Not run)

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