Adds a column for cohort indices to a data frame, derived from specified age and period index columns through the relationship cohort index = period index - age index + max(age index).
add_cohort_index(data, age_index, period_index, cohort_name = "cohort_index")Data frame with additional column for cohort indices.
Data frame with age and period columns.
Age index column in data.
Period index column in data.
Name of the cohort index column to be created. Defaults to "cohort_index".