SimInf_individual_eventsStorage class for cleaned individual-level event data, such as
births, deaths, and movements. This class serves as an
intermediate step in the data preparation pipeline, holding raw
records that will later be aggregated into the scheduled events
(SimInf_events) required by a
SimInf_model at predefined time-points.
idAn integer or character vector serving as a unique identifier for each individual.
eventThe type of event. Four types are supported: exit, enter, internal transfer, and external transfer. These can be specified as either a numeric code or a character string:
0 or "exit": Individual leaves the
system.
1 or "enter": Individual enters the
system.
2 or "intTrans": Individual moves within
the same node.
3 or "extTrans": Individual moves to a
different node.
timeA numeric, character, or Date vector indicating
when the event occurred. Character strings must be coercible
to Date (e.g., "2023-01-15").
nodeAn integer or character vector identifying the source node for the event.
destAn integer or character vector identifying the
destination node. For exit and enter
events, this value is typically NA or unused.
The typical workflow is:
Collect raw individual event data (e.g., from a database).
Clean and validate it using
individual_events, which returns a
SimInf_individual_events object.
Aggregate the individual events into node-level scheduled
events for the model, for example using
u0_from_individual_events to derive the initial
state.
individual_events for cleaning and processing raw
event data into this class format,
u0_from_individual_events for deriving the initial
state from these events, and SimInf_events
for the node-level aggregated event format used by the solver.