Format age categories

age_categories() group_age_categories()

Create an age group variable

Calculate proportions

Use these functions to calculate tables of proportions using binom::binom.wilson()

attack_rate() case_fatality_rate() case_fatality_rate_df() mortality_rate()

Rates and Ratios

Format proportions and confidence intervals inline

Use these functions to produce inline text in Rmarkdown documents

fmt_ci() fmt_pci() fmt_pci_df() fmt_ci_df()

Helper to format confidence interval for text


Counts and proportions inline

Generate breaks for grouping or color scales


Automatically calculate breaks for a number

Generate population counts


Generate population counts from estimated population age breakdowns.

Find first date/cause of an event beyond a cutoff over several columns

Use these functions to find what event occured first and when (e.g. died, lost to follow-up, survived)

find_date_cause() find_start_date() find_end_date() constrain_dates() assert_positive_timespan()

Find the first date beyond a cutoff in several columns

Add population weights to complex survey design data


Add a column of stratified survey weights to a data frame. For use in surveys where you took a sample population out of a larger source population, with a simple-random or stratified survey design.


Add a column of cluster survey weights to a data frame.

Plot z-curves to compare anthropometric indicators to WHO standards


Create a curve comparing observed Z-scores to the WHO standard.

Modify column names

rename_redundant() augment_redundant()

Cosmetically relabel all columns that contains a certain pattern

unite_ci() merge_ci_df() merge_pci_df()

Unite estimates and confidence intervals



create factors from numbers


Fake spatial data as polygons This function returns a polygon which is split in to regions based on a supplied vector of names