add_cohort_index {MAPCtools} | R Documentation |
Add cohort column to data frame
Description
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)
.
Usage
add_cohort_index(data, age_index, period_index, cohort_name = "cohort_index")
Arguments
data |
Data frame with age and period columns. |
age_index |
Age index column in |
period_index |
Period index column in |
cohort_name |
Name of the cohort index column to be created. Defaults to |
Value
Data frame with additional column for cohort indices.
[Package MAPCtools version 0.1.0 Index]