Description
Demographic Analysis and Data Manipulation.
Description
Perform tasks commonly encountered when preparing and analysing demographic data. Some functions are intended for end users, and others for developers. Includes functions for working with life tables.
README.md
poputils 
Manipulate and analyse demographic data.
Installation
install.packages("poputils") ## CRAN version
devtools::install_github("bayesiandemography/poputils") ## development version
For end users
Data manipulation
logit()
,invlogit()
Logistic transformationtrim_01()
Trim values to interval (0, 1)rr3()
Randomly round to base 3
Life expectancy, life tables
ex_to_lifetab_brass()
Use the Brass logit model to derive life tables with specified life expectancieslifeexp()
Calculate life expectancy from mortality rateslifetab()
Calculate life tables from mortality ratesq0_to_m0()
Infant mortality
Labels
age_labels()
Create age labelsage_lower()
,age_mid()
,age_upper()
Limits and midpoints of age groupscombine_age()
Merge age group labelsreformat_age()
Reformat age group labelsreformat_sex()
Reformat sex labelsset_age_open()
Specify oldest age group
For developers
Checking arguments
check_n()
Check an integer scalar.
Data manipulation
check_no_overlap_colnums()
Check for argument clashesgroups_colnums()
Get column numbers for grouping variablesmatrix_to_list_of_cols()
,matrix_to_list_of_rows()
Split matrixto_matrix()
Convert data frame to matrix
Labels
age_group_type()
Infer type of age group labelcheck_age()
Validity checks for age group labelsfind_label_female()
,find_label_male()
Identify sex or gender labelsfind_var_age()
,find_var_sexgender()
,find_var_time()
Identify age, sex/gender, time variables.