View source: R/life_expectancy.R
| life_expectancy | R Documentation | 
Returns remaining life expectancy at a given age (0 by default).
life_expectancy(.data, from_age = 0, mortality)
.data | 
 A vital object including an age variable and a variable containing mortality rates.  | 
from_age | 
 Age at which life expectancy to be calculated. Either a scalar or a vector of ages.  | 
mortality | 
 Variable in   | 
A vital object with life expectancy in column ex.
Rob J Hyndman
Chiang CL. (1984) The life table and its applications. Robert E Krieger Publishing Company: Malabar.
Keyfitz, N, and Caswell, H. (2005) Applied Mathematical Demography, Springer-Verlag: New York.
Preston, S.H., Heuveline, P., and Guillot, M. (2001) Demography: measuring and modeling population processes. Blackwell
life_table()
# Compute Norwegian life expectancy for females over time
norway_mortality |>
  dplyr::filter(Sex == "Female") |>
  life_expectancy()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.