Demographic Analysis and Data Manipulation

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.


poputils

Lifecycle:experimental R-CMD-check Codecov testcoverage CRANstatus

Manipulate and analyse demographic data.

Installation

install.packages("poputils")

For end users

Data manipulation

  • logit(), invlogit() Logistic transformation
  • trim_01() Trim values to interval (0, 1)
  • rr3() Randomly round to base 3

Labels

  • age_labels() Create age labels
  • age_lower(), age_mid(), age_upper() Limits and midpoints of age groups
  • combine_age() Merge age group labels
  • reformat_age() Reformat age group labels
  • reformat_sex() Reformat sex labels
  • set_age_open() Specify oldest age group

Life expectancy, life tables

  • e0_to_lifetab_logit() Life table from Brass logit model
  • lifeexp() Life expectancy from mortality rates
  • lifetab() Life tables from mortality rates
  • q0_to_m0() Infant mortality

Fertility

  • tfr() Calculate total fertility rates
  • tfr_to_asfr_scale() Age-specific fertility rates from scaling

For developers

Checking arguments

  • check_n() Check an integer scalar.

Data manipulation

  • check_no_overlap_colnums() Check for argument clashes
  • groups_colnums() Get column numbers for grouping variables
  • matrix_to_list_of_cols(), matrix_to_list_of_rows() Split matrix
  • to_matrix() Convert data frame to matrix

Labels

  • age_group_type() Infer type of age group label
  • check_age() Validity checks for age group labels
  • find_label_female(), find_label_male() Identify sex or gender labels
  • find_var_age(), find_var_sexgender(), find_var_time() Identify age, sex/gender, time variables

Stable populations

  • .intrinsic_growth_rate() Growth rate implied by mortality, fertility schedules

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("poputils")

0.6.1 by John Bryant, 8 months ago


https://bayesiandemography.github.io/poputils/, https://github.com/bayesiandemography/poputils


Report a bug at https://github.com/bayesiandemography/poputils/issues


Browse source code at https://github.com/cran/poputils


Authors: John Bryant [aut, cre] , Bayesian Demography Limited [cph]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports cli, lifecycle, rlang, rvec, tibble, tidyselect, utils, vctrs

Suggests bookdown, covr, dplyr, ggplot2, knitr, rmarkdown, testthat

Linking to cpp11


Imported by bage.


See at CRAN