# age_pyramid

##### Age pyramid from a population data frame at a given time.

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}`

.

##### Usage

`age_pyramid(population, time = 0, ages = c(0:110, Inf))`

##### Arguments

- population
Population data frame: characteristics in columns and individuals in rows. At least two columns

`birth`

(dates of birth) and`death`

(dates of death) are required.- time
The age pyramid is computed at instant

`time`

. Must be a numeric greater than or equal to 0.- ages
*(Optional)*A numeric vector of distinct positive values composing age groups. Must be in increasing order.

##### Details

See also `age_pyramids`

.

##### Value

Age pyramid of a population at instant `time`

. A data frame with columns `age`

and `value`

. Optional characteristics are preserved.

##### Examples

```
# NOT RUN {
age_pyramid(EW_pop_14$sample, time = 0)
age_pyramid(EW_popIMD_14$sample, time = 0, ages = seq(0, 120, by=2))
# }
```

*Documentation reproduced from package IBMPopSim, version 0.3.0, License: MIT + file LICENSE*