Description Usage Arguments Value See Also Examples
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.
1 2 3 4 | lifeExpectancy(object, age = 0)
## S4 method for signature 'LifeTable'
lifeExpectancy(object, age = 0)
|
object |
An object of class |
age |
The age from which life expectancy is calculated. Defaults to 0. |
An object of class Values
, or, if,
there is only one dimension, a numeric vector.
Values for life expectancy can also be extracted from a
LifeTable
object using lifeTableFun
,
though in this case all ages are shown.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.