Reads a Human Mortality Database (HMD) period life table file (1x1, by single
year of age) for the selected sex and returns only the last look_back
years based on the latest year present in the file. The open-ended age group
(e.g. "110+") is parsed as its numeric lower bound (e.g. 110).
Usage
read_life_table(directory, sex = c("f", "m"), look_back = 20)Arguments
- directory
Directory containing the HMD life table files (
"mltper_1x1.txt"/"fltper_1x1.txt"or gzipped variants"mltper_1x1.txt.gz"/"fltper_1x1.txt.gz").- sex
Sex code:
"m"(male) or"f"(female).- look_back
Number of most recent years to keep (inclusive of the latest available year). Must be >= 1.