EventLogger | R Documentation |
EventLogger
is an R6 class for an object that tracks migration,
transmission, and coalescent events. Note that bottleneck events are logged as
coalescent events.
new()
EventLogger$new(events = NA)
get.all.events()
EventLogger$get.all.events()
get.events()
EventLogger$get.events(event.type)
add.event()
EventLogger$add.event( type, time, line1 = NA, line2 = NA, comp1 = NA, comp2 = NA, type1 = NA, type2 = NA )
type:
event type, one of 'transmission', 'transition', 'migration', 'coalescence' or 'bottleneck'.
time:
CUMULATIVE time that event has occurred between two compartments in a transmission/migration/coalescent event Record which Lineages are transmitted from source to recipient (should only be one entry with Compartment as recipient)
clear.events()
EventLogger$clear.events()
blank.events()
EventLogger$blank.events()
record.transmission()
EventLogger$record.transmission(recipient, lineages)
recipient:
Compartment object
lineages:
a vector of names of Lineages to transfer out of recipient Compartment Record which Lineages are transmitted from source to recipient through a migration event
record.migration()
EventLogger$record.migration(recipient, source, time, lineages)
recipient:
Compartment object
source:
Compartment object
time:
double, time of migration event
lineages:
a list of Lineage objects
get.fixed.samplings()
EventLogger$get.fixed.samplings()
store.fixed.samplings()
EventLogger$store.fixed.samplings(model.fixed.samplings)
clone()
The objects of this class are cloneable with this method.
EventLogger$clone(deep = FALSE)
deep
Whether to make a deep clone.
# manually initialize an EventLog object
e <- EventLogger$new()
# note this log entry is not linked to existing Lineage or Compartment objects
e$add.event("transmission", time=1, line1="NA", comp1="host1", comp2="host2")
e$get.all.events()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.