View source: R/export-DataPreprocessing.R
as.APC.df | R Documentation |
Add 1-indexed APC columns to data frame, handling numeric or categorical age/period
as.APC.df(data, age, period, age_order = NULL, period_order = NULL, M = 1)
data |
Data frame with age and period columns. |
age |
Age column in |
period |
Period column in |
age_order |
(Optional) Character vector giving the desired order of age levels.
If NULL and the |
period_order |
(Optional) Vector (numeric or character) giving the desired order of periods.
If NULL and |
M |
Grid factor, defined as the ratio of age interval width to period interval width. Defaults to 1 (i.e. assuming equal sized age and period increments). |
The data frame with new columns \code{age_index}, \code{period_index}, \code{cohort_index}, and sorted by \code{(age_index, period_index)}.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.