lifeExpectancy: Calculate life expectancy.

Description Usage Arguments Value See Also Examples

Description

Obtain life expectancies from an object of class LifeTable. By default, lifeExpectancy returns life expectancy at age 0, but other ages can be used instead.

Usage

1
2
3
4
lifeExpectancy(object, age = 0)

## S4 method for signature 'LifeTable'
lifeExpectancy(object, age = 0)

Arguments

object

An object of class LifeTable.

age

The age from which life expectancy is calculated. Defaults to 0.

Value

An object of class Values, or, if, there is only one dimension, a numeric vector.

See Also

Values for life expectancy can also be extracted from a LifeTable object using lifeTableFun, though in this case all ages are shown.

Examples

1
2
3
4
5
6
7
8
al <- demdata::afghan.life
al <- dembase::Values(al)
mx <- dembase::subarray(al,
               subarray = (fun == "mx") & (time == "2001-2005"))
lt <- LifeTable(mx)
lt
lifeExpectancy(lt)
lifeExpectancy(lt, age = 65)

StatisticsNZ/demlife documentation built on April 27, 2021, 10:02 p.m.