Description Usage Arguments Details Author(s) Examples
View source: R/lexis_polygon.R
Plot a polygon inside a Lexis grid Takes an existing Lexis grid and adds a polygon.
1 2 | lexis_polygon(lg, x, y, group = 1, fill = lexisplotr_colours()[4],
alpha = 0.7)
|
lg, |
an existing object originally created with |
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. |
The function can be used to plot a polygon inside a Lexis grid.
Philipp Ottolinger
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.