Extract the number of individuals in each stage from a dataframe of transitions.

get_state_vector(transitions, stage = NULL, sort = NULL)

Arguments

transitions

a dataframe of observations of individuals in different stages

stage

the name of the variable with the stage information

sort

a vector of stage names in the desired order. Default is the order of levels in stage.

Value

a vector of the counts of observations in each level of stage.