Skip to contents

Read baseline population by single-year age from an Excel file.

Usage

read_pop(path)

Arguments

path

Excel file path storing baseline population data.

Value

A numeric data frame with six columns: age, male, female, mdr, fdr, asfr.

Details

Expected columns (sheet 1, in order) are: age, male, female, mdr, fdr, asfr.

mdr and fdr are expected in per-thousand units in Excel; the function converts them to probability scale by dividing by 1000.

Examples

data("infile_pop", package = "fastproj")
tf <- tempfile(fileext = ".xlsx")
openxlsx::write.xlsx(infile_pop, tf)
baseline <- read_pop(tf)
str(baseline)
#> 'data.frame':	101 obs. of  6 variables:
#>  $ age   : num  0 1 2 3 4 5 6 7 8 9 ...
#>  $ male  : num  779335 823446 926283 1003041 873206 ...
#>  $ female: num  678924 719030 814074 879529 756912 ...
#>  $ mdr   : num  1.18e-06 2.90e-07 1.50e-07 1.40e-07 1.20e-07 1.00e-07 1.00e-07 1.10e-07 1.20e-07 1.10e-07 ...
#>  $ fdr   : num  9.7e-07 2.2e-07 1.4e-07 1.3e-07 1.0e-07 9.0e-08 8.0e-08 8.0e-08 8.0e-08 7.0e-08 ...
#>  $ asfr  : num  0 0 0 0 0 0 0 0 0 0 ...