Description Usage Arguments Details Author(s) Examples
The function opens an existing Lexis grid and fill the triangles according to data from the Human Mortality Database.
1 | lexis.hmd(lg, hmd.data, column)
|
lg, |
an existing object originally created with |
hmd.data, |
a data.frame created with |
column |
character, the name of the column of |
The function creates a subset of hmd.data
that fits in the dimensions of the existing Lexis grid.
The triangles will be filled according to the data in column
.
Philipp Ottolinger
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
library(LexisPlotR)
lg <- lexis.grid(year.start = 1980, year.end = 1985, age.start = 0, age.end = 5)
# Load sample data
path <- system.file("extdata", "Deaths_lexis_sample.txt", package = "LexisPlotR")
deaths.triangles <- prepare.hmd(path)
lexis.hmd(lg = lg, hmd.data = deaths.triangles, column = "Total")
### Plot data not explicitly present in HMD data
deaths.triangles$RatioMale <- deaths.triangles$Male / deaths.triangles$Total
lexis.hmd(lg, deaths.triangles, "RatioMale")
## End(Not run)
|
Loading required package: ggplot2
Warning message:
In prepare.hmd(path) : NAs introduced by coercion
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.