View source: R/export-DataPreprocessing.R
add_APC_by_match | R Documentation |
Add 1-indexed age, period and cohort indices via match()
add_APC_by_match(df, age_name, period_name, age_order, period_order, M = 1)
df |
Data frame |
age_name |
Name of the age (or age-group) column (string). |
period_name |
Name of the period (e.g. year) column (string). |
age_order |
Character vector giving the desired ordering of age levels |
period_order |
Vector (numeric or character) giving the desired ordering of periods |
M |
Grid factor, defined as the ratio of age interval width to period interval width. |
Data frame with new columns: age_index, period_index, cohort_index
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.