View source: R/export-DataPreprocessing.R
add_cohort_index | R Documentation |
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 |
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 |
Data frame with additional column for cohort indices.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.