Description Usage Arguments Details Value See Also Examples
Given a vector of age group labels, create a factor that contains
levels for all ages between 0 and break_max,
plus an open age group (ie an age group with no upper limit.)
The age groups created by format_age_lifetab
are the ones typically used in
"abridged" life tables: "0",
"1-4", "5-9", "10-14", and so on up to the
highest age group, which is always open.
1 | format_age_lifetab(x, break_max = 100)
|
x |
A vector of age group labels. |
break_max |
An integer or |
break_max is used to specify
the oldest age group.
If break_max is NULL, the oldest
age group is derived from the data.
All age groups in x must fall within the intervals
"0", "1-4", "5-9", ....
If x contains NA, then the
levels of the factor created by format_age_lifetab
also contain NA.
A factor with the same length as x.
Other functions for reformating age group labels are
format_age_year
format_age_multi
format_age_births
format_age_custom
format_age_quarter
format_age_month
date_to_age_year calculates
ages from dates.
1 2 3 4 5 | format_age_lifetab(x = c("100+", "14", "1-4"))
## set oldest age group to 50+
format_age_lifetab(x = c("100+", "14", "1-4"),
break_max = 80)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.