Learn R Programming

lifecontingencies (version 1.6.0)

autoplot.lifetable: Autoplot a life table

Description

Produces a ggplot2 representation of the number of survivors by age. The method is defined for `lifetable`; S3 dispatch also makes it available for S4 subclasses such as `actuarialtable`.

Usage

# S3 method for lifetable
autoplot(object, ...)

Value

A `ggplot2` plot object.

Arguments

object

A `lifetable` object, or an object inheriting from it.

...

Additional arguments passed to `ggplot2::geom_line()`.

Examples

Run this code
lt <- new("lifetable", x = 0:3, lx = c(100, 90, 50, 10))
ggplot2::autoplot(lt)

Run the code above in your browser using DataLab