Imagine having a population where age of individuals is known. I would like to sample from this population individuals by age according to a parametric distribution (e.g. X ~ Poisson(1.82)). In other words, I would like to remove a known number of individuals from each class, where class sizes follows a Poisson distribution.
Is there a more elegant way?
ma <- 10 # max age
ss <- 50 # sample size
l <- 1.82 # lambda in Poisson distribution
set.seed(357)