Run | R Documentation |
Run
is an R6 class that is derived from Model
. It inherits
all simulation model features including CompartmentTypes, Compartments,
and Lineages. Unlike Model
, a Run
object is used to track
an outcome of the simulation model and is therefore mutable where Model
is immutable. For example, Run
tracks which lineages are extant and
the numbers of pairs of Lineages that can coalesce over time. In addition,
the number of unsampled compartments is stochastic outcome of the model that
is tracked at this level.
lineages:
list of Lineage objects
extant.lineages:
list of Lineage objects filtered by sampling time
locations:
a named list of Lineage objects keyed by Compartment
counts:
a data frame of population dynamics
lineages:
list of Lineage objects
extant.lineages:
list of Lineage objects filtered by sampling time
locations:
a named list of Lineage objects keyed by Compartment
counts:
a data frame of population dynamics
new()
Run$new(model)
get.eventlog()
Run$get.eventlog()
set.eventlog()
Run$set.eventlog(e)
get.counts()
Run$get.counts()
set.counts()
Run$set.counts(df)
get.initial.conds()
Run$get.initial.conds()
get.fixed.samplings()
Run$get.fixed.samplings()
get.types()
Run$get.types()
get.compartments()
Run$get.compartments()
get.lineages()
Run$get.lineages()
get.unsampled.hosts()
Run$get.unsampled.hosts()
get.num.extant()
Run$get.num.extant(time, location = NA)
get.sampling.times()
Run$get.sampling.times()
time:
reference time point
location:
(optional) name of Compartment object
integer, number of extant lineages
Retrieves a list of Lineage objects that are extant at the specified time. Note that because Lineages are being added and removed through coalescent and bottleneck events, the output will change over the course of inner tree simulation.
get.extant.lineages()
Run$get.extant.lineages(time, comp = NA)
add.lineage()
Run$add.lineage(lineage)
time:
coalescent (cumulative time) of the simulation
comp:
R6 object of class Compartment
a named list of Lineage objects.
remove.lineage()
Run$remove.lineage(lineage)
move.lineage()
Run$move.lineage(lineage, comp)
get.locations()
Run$get.locations()
get.node.ident()
Run$get.node.ident(prefix = "Node")
generate.unsampled()
Run$generate.unsampled(type.name)
clear.unsampled()
Run$clear.unsampled()
clone()
The objects of this class are cloneable with this method.
Run$clone(deep = FALSE)
deep
Whether to make a deep clone.
https://github.com/r-lib/roxygen2/issues/415 count the number of Lineages that are extant (has been sampled) more recently than the user-specified time
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.