Description Usage Arguments Details Value Examples
Identify the elements of a vector that are valid labels for age groups. Each element is assessed independently, so the labels can overlap.
1 | is_valid_age(x)
|
x |
A vector. |
NA
s are treated as valid labels.
A logical vector, the same length as x
.
1 2 3 4 5 6 7 8 9 | ## years
x <- c("1-4", "12-10", "100+", "old", NA)
is_valid_age(x)
## age groups are allowed to overlap,
## provided that each individual
## label is valid
x <- c("10-19", "15-19", "5+")
is_valid_age(x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.