AGEN | R Documentation |
Determining which N-year (e.g. 5-year) age groups two vectors have in common is helpful for matching vector lengths, and questions of alignment. Used as a utility throughout.
AGEN(
Age1,
Age2,
N = 5,
consecutive = TRUE,
ageMin = 0,
ageMax = max(c(Age1, Age2))
)
Age1 |
integer. Vector of first age groups (lower bounds). |
Age2 |
integer. Vector of second age groups (lower bounds). |
N |
integer. Target age group interval (just one number). |
consecutive |
logical. Whether or not to throw error if resulting age groups not consecutive. Default |
ageMin |
integer. Optional lower age bound for output. |
ageMax |
integer. Optional upper age bound for output. |
Integer vector of the N-year age groups present in both Age1
and Age2
.
Age1 <- seq(0, 100, by = 5)
Age2 <- 0:80
AGEN(Age1, Age2, N = 5)
AGEN(Age1, Age2, N = 5, ageMax = 70)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.