This internal function specifically takes a data frame the contains rows that provide the an integer time, a state and the number of agents that entered that state at that time (this data frame only contains counts > 0).
expanding_info(df, t_min, t_max, K)
df | data frame with |
---|---|
t_min | minimum integer time |
t_max | maximum integer time |
K | (number of stages - 1) (e.g.: SIR has K = 2) |
expanded data frame: a data frame with columns t
and a set of
the unique states
as columns. For each row, it contains the number
of agents to change to said state at specified time.
This function then outputs a "pivot_longer
" data frame, that has 1 row
per integer time period between (and including) t_min and t_max. Even if 0
agents change their state at that given time. The columns (beyond t
)
relate to each state.