Description Usage Arguments Details Value
View source: R/setup_simulation.R
This function creates a rec_df
dataframe object, which is used to record all
cases that ever get created within a simulation.
1 2 3 4 5 6 | create_record_df(
state_df,
sim_status,
initialize = FALSE,
infection_source = NULL
)
|
state_df |
|
sim_status |
The |
initialize |
A boolean indicating whether these cases are the first cases of the
simulation. Defaults to |
infection_source |
A string or vector of case_ids representing the source of each
case's infection. Defaults to |
The simulation's main rec_df
dataframe is created with this
function at the beginning of the simulation. When new cases are added (secondary or
imported infections), a rec_df
dataframe is created for these new cases
by generate_secondary_infections
and generate_imported_infections
.
The new rec_df
object is merged with the main rec_df
within
step_simulation
.
The columns of this dataframe are: case_id
, source
, is_traced
,
is_trace_app_user
, is_traced_by_app
, is_trace_app_comply
,
is_symptomatic
, d_incub
, d_iso_delay
, d_infection
,
contact_rate
, n_sec_infects
, d_generation_ints
, t_inf
,
t_symp
, t_iso
, t_inact
, cases_inf
, s_status
,
and non_infect_generations
. The meaning of these columns will be documented elsewhere.
Columns case_id
through t_inf
as well as column
non_infect_generations
are constant and are initialized when this function
is called, using the provided state_df
object. The columns t_symp
,
t_iso
and t_inact
are initialized as NA
and replaced with the actual
simulation time where these events happen. If they do not happen (e.g. an asymptomatic
case will not have a t_symp
or t_iso
), then the value remains as NA
.
The column cases_inf
is meant for a list of case_id of all secondary infections
caused by the given case but is not yet implemented. The column s_status
is updated
by step_simulation
at the appropriate time in the simulation.
Note that all time lengths are given in days and values in columns beginning with
d_
are a period of days since the relevant reference time while columns
beginning with t_
are absolute time, measured in days since the simulation began.
A rec_df
dataframe object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.