Skip to contents

Draws the classic life table figures in the house style: the survivorship \(l_x\), the hazard \(m_x\) on a log scale, the death distribution \(d_x\) and the life expectancy \(e_x\). When the table holds several life tables, from a matrix input or from a LawTable built on several parameter sets, each table is drawn as one curve and the legend labels the tables.

Usage

# S3 method for class 'LifeTable'
plot(x, which = c("all", "lx", "hazard", "dx", "ex"), split = NULL, ...)

Arguments

x

An object of class "LifeTable".

which

Which panels to draw: "all" (the default; the four panels), or a single panel: "lx", "hazard", "dx" or "ex".

split

How to arrange the panels when more than one is drawn: NULL (the default) draws the four panels in a c(2, 2) grid; give a length-2 integer c(nrow, ncol) to split them yourself, such as c(1, 4) for one row or c(4, 1) for one column.

...

Further arguments; currently ignored.

Value

The object x, invisibly. Called for the plot it draws.

See also

Author

Marius D. Pascariu

Examples

x  <- as.numeric(rownames(ahmd$mx))
LT <- LifeTable(x = x, mx = ahmd$mx[, c("1950", "2010")])
#> 'mx' contains missing or non-finite values at age(s) 110. Rows below age 100 are returned as NA with the survivorship bridged across the gap; rows from age 100 are replaced with the highest rate observed there.
plot(LT)

plot(LT, which = "lx")

plot(LT, split = c(1, 4))