Learn R Programming

IBMPopSim (version 1.1.0)

age_pyramid.population: Age pyramid from a population at a given time.

Description

Reduce a population 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

# S3 method for population
age_pyramid(object, time = 0, ages = c(0:110, Inf), ...)

Value

An object of class pyramid containing the age pyramid of the given population at instant time.

Arguments

object

Object of population class representing a population.

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.

...

Additional parameters

See Also

age_pyramids.population

Examples

Run this code
age_pyramid(population(EW_pop_14$sample), time = 0)

age_pyramid(population(EW_popIMD_14$sample), time = 0, ages = seq(0, 120, by=2))

Run the code above in your browser using DataLab