expanding_info: expanding aggregate data to desirable format

Description Usage Arguments Details Value

View source: R/agent-to-aggregate.R

Description

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).

Usage

1
expanding_info(df, t_min, t_max, K)

Arguments

df

data frame with state, t and count columns which provide information on the number of agents that became said state at time t.

t_min

minimum integer time

t_max

maximum integer time

K

(number of stages - 1) (e.g.: SIR has K = 2)

Details

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.

Value

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.


skgallagher/EpiCompare documentation built on Sept. 14, 2021, 5:45 a.m.