age2ageN | R Documentation |
This is a frequent grouping situation. For a given vector of lower age bounds, repeat each value N times, where N is the width of the corresponding age interval. Age intervals are in this case calculated from the original Age vector.
age2ageN(Age, AgeInt = NULL, OAG = FALSE)
Age |
integer. Vector of lower age bounds. |
AgeInt |
integer vector of age group widths. |
OAG |
logical. Whether or not the final age group open. Default |
If OAG = TRUE
then the last value is not repeated, otherwise the final age interval is assumed to be the same width as the penultimate. Here intervals do not need to be of uniform width.
integer vector of elements of Age
repeated once for each implied single age.
age1 <- seq(0,100,by=5)
(ageN1 <- age2ageN(age1, OAG = FALSE))
(ageN2 <- age2ageN(age1, OAG = TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.