Check whether a vector of ages consists in single ages. This makes sense sometimes when age intervals are not explicitly given.

is_single(Age)

Arguments

Age

integer. Vector of age classes.

Value

logical. TRUE if detected as single ages, FALSE otherwise.

Details

In cases where ages are indeed single, but repeated, this will still return FALSE. Therefore make sure that the age vector given refers to a single year of a single population.

Examples

Age <- 0:99 Age2 <- c(0:10,0:10) Age3 <- seq(0,80,by=5) Age4 <- seq(0,10,by=.5) is_single(Age) # TRUE
#> [1] TRUE
is_single(Age2) # FALSE repeated, can't tell.
#> [1] FALSE
is_single(Age3) # FALSE not single ages
#> [1] FALSE
is_single(Age4) # FALSE not single ages
#> [1] FALSE