powered by
Calculates summary statistics from a subset of a population; used if a count survey is to be simulated with a subset of the complete population.
summaryPop(state, subset)
A matrix with the numbers in each adult age class for each year, total adults, and number of female juveniles.
individuals x years matrix for the population with ages of adult individuals plus newborns (coded 0) and died (-1), usually the output from simPop.
simPop
vector with the indices of the individuals that are to be included for the summary statistics; if missing, all individuals are included.
Michael Schaub
pop <- simPop() summaryPop(pop$state) # default is to include all, compare with pop$N # define a subset of 80 drawn at random sset <- sample(nrow(pop$state), 80) summaryPop(pop$state, subset=sset)
Run the code above in your browser using DataLab