Description Usage Arguments Details Value
Creates age groups using a numeric age variable
1 | agegroup.create(df, age_var, ll = NULL, ul = NULL)
|
df |
a data.frame containing the age variable |
age_var |
the index of the age variable within the data.frame. It is a numeric column. The unit does not matter. |
ll |
an ordered vector containing the lower limit for each age group. It is a numeric vector. |
ul |
an ordered vector containing the upper limit for each age group. It is a numeric vector. |
If ll and/or ul are not provided the function uses a default age grouping containg the following groups: 0-4, 5-17, 18-44, 45-64, 65+ (65 and above).The internal upper limit for the default age grouping is 120 years. Above that treshold the age will be classified as "U" for unknown.
the same data.frame to which a new "Agecat" column has been added. The class of the column is character.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.