Adds a column for birth cohorts to a data frame, derived from specified age and period columns through the relation cohort = period - age
.
add_cohort_column(data, age, period, cohort_name = "cohort")
Data frame with additional column for birth cohorts added.
Data frame with age and period column.
Age column in data
.
Period column in data
.
Name of the cohort column to be created. Defaults to "cohort"
.