Extract the number of individuals in each stage from a dataframe of transitions.
Examples
data("L_elto")
# Extract one population at one census period
onepop <- L_elto[L_elto$POPNUM == 250 & L_elto$year == 5, ]
onepop$stage <- factor(onepop$stage, levels = c("p", "j", "a"))
# Count individuals per stage in the order p, j, a
get_state_vector(onepop, stage = "stage", sort = c("p", "j", "a"))
#> [1] 11 47 34