IBMPopSim (version 0.3.0)

popsample: Sample a population from an age pyramid (at a given time).

Description

Sample a population from an age pyramid (at a given time).

Usage

popsample(age_pyramid, size, age_max = 120, time = 0)

Arguments

age_pyramid

A data frame with columns age, value and others optional characteristics.

size

A non-negative integer giving the number of individuals in population.

age_max

(Optional) A non-negative numeric which replace (if exists) the Inf in age_pyramid.

time

(Optional) The age pyramid is computed at instant time. Must be a numeric greater than or equal to 0.

Value

A data frame of size size containing a population of individuals.

Examples

Run this code
# NOT RUN {
pop_sample_1e4 <- popsample(EW_pop_14$age_pyramid, size = 1e4)

# }

Run the code above in your browser using DataLab