is_single: Logical checking of whether age classes appear single.

View source: R/utilsAge.R

is_singleR Documentation

Logical checking of whether age classes appear single.

Description

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

Usage

is_single(Age)

Arguments

Age

integer. Vector of age classes.

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.

Value

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

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
is_single(Age2) # FALSE repeated, can't tell.
is_single(Age3) # FALSE not single ages
is_single(Age4) # FALSE not single ages

timriffe/DemoTools documentation built on Oct. 14, 2024, 12:53 p.m.