age_pyramid {IBMPopSim} | R Documentation |
Reduce a population data frame containing all individuals (with some characteristics) to an age-groups data frame (preserving characteristics). The function computes the number of individuals at time
in each age group [ages[i],ages[i+1][
, for i
in {1,...,N-1}
.
age_pyramid(population, time = 0, ages = c(0:110, Inf))
population |
Population data frame: characteristics in columns and individuals in rows. At least two columns |
time |
The age pyramid is computed at instant |
ages |
(Optional) A numeric vector of distinct positive values composing age groups. Must be in increasing order. |
See also age_pyramids
.
Age pyramid of a population at instant time
. A data frame with columns age
and value
. Optional characteristics are preserved.
age_pyramid(EW_pop_14$sample, time = 0)
age_pyramid(EW_popIMD_14$sample, time = 0, ages = seq(0, 120, by=2))