Skip to contents

read_ktdb_file reads old-age mortality data from a file downloaded from K-T database (https://www.demogr.mpg.de/cgi-bin/databases/ktdb/datamap.plx) and constructs a vital object suitable for use in other functions. If two files are provided, the function will treat them as data for each gender, returning a combined dataset. If only one file is provided, the function will assume that it represents data for a single gender.

Usage

read_ktdb_file(file1, file2 = NULL, triangle = 1, male_first = TRUE)

Arguments

file1

Name of the first file containing data downloaded from the K-T database.

file2

Name of the second file containing data downloaded from the K-T database.

triangle

Lexis triangle number, 1 (default) is lower triangle, 2 is upper triangle.

male_first

Indicator of whether file1 is for males. Default is TRUE.

Value

read_ktdb_file returns a vital object combining the downloaded data.

Author

Sixian Tang

Examples

if (FALSE) { # \dontrun{
# File downloaded from the K-T database
australia_male <- read_ktdb_file("maustl.txt")
} # }