Sample a population from an age pyramid (at a given time).
popsample(age_pyramid, size, age_max = 120, time = 0)
A data frame with columns age, value and others optional characteristics.
age
value
A non-negative integer giving the number of individuals in population.
(Optional) A non-negative numeric which replace (if exists) the Inf in age_pyramid.
Inf
age_pyramid
(Optional) The age pyramid is computed at instant time. Must be a numeric greater than or equal to 0.
time
A data frame of size size containing a population of individuals.
size
# NOT RUN { pop_sample_1e4 <- popsample(EW_pop_14$age_pyramid, size = 1e4) # }
Run the code above in your browser using DataLab