age2int | R Documentation |
Determine age class intervals based on a vector of age class lower bounds.
age2int(Age, OAG = TRUE, OAvalue = NA)
Age |
integer or numeric. Vector of lower age group bounds . |
OAG |
logical. Whether or not the final age group is open. Default |
OAvalue |
numeric or integer. The value to use for the final age interval if |
If the final age group is open, it is given a value of NA
by default, or else a user-determined value.
If the final age group is closed, it is assumed to be equal to the next-lower interval. If the final age interval is
known and not equal to the next lowest interval, specify OAG = TRUE
and assign its value to OAvalue
.
Age interval vector, of same length as Age
.
# single age examples:
Age <- 0:100
age2int(Age, OAG = TRUE, OAvalue = NA)
age2int(Age, OAG = TRUE, OAvalue = Inf)
age2int(Age, OAG = FALSE)
# and for abridged ages:
AgeA <- c(0,1,seq(5,85,by=5))
age2int(AgeA, OAG = TRUE, OAvalue = NA)
age2int(AgeA, OAG = TRUE, OAvalue = Inf)
age2int(AgeA, OAG = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.