Compartment | R Documentation |
Compartment
is an R6 class for objects that represent the units of an
outer tree simulation, such as a host individual or deme.
new()
Compartment$new( name = NA, type = NA, source = NA, branching.time = NA, sampling.time = NA, unsampled = FALSE, lineages = list() )
copy()
Compartment$copy(deep = FALSE)
get.name()
Compartment$get.name()
get.type()
Compartment$get.type()
get.source()
Compartment$get.source()
get.branching.time()
Compartment$get.branching.time()
get.sampling.time()
Compartment$get.sampling.time()
set.type()
Compartment$set.type(new.type)
set.source()
Compartment$set.source(new.source)
set.branching.time()
Compartment$set.branching.time(new.branching.time)
set.sampling.time()
Compartment$set.sampling.time()
set.unsampled()
Compartment$set.unsampled(is.unsampled)
is.unsampled()
Compartment$is.unsampled()
get.lineages()
Compartment$get.lineages()
add.lineage()
Compartment$add.lineage(new.lineage)
remove.lineage()
Compartment$remove.lineage(ex.lineage)
clone()
The objects of this class are cloneable with this method.
Compartment$clone(deep = FALSE)
deep
Whether to make a deep clone.
# load Compartments from a YAML object
path <- system.file('extdata', 'SI.yaml', package='twt')
settings <- yaml.load_file(path)
mod <- MODEL$new(settings)
# display first Compartment object
host1 <- mod$get.compartments()[[1]]
host1
# manually initialize a new Compartment object
hostN <- Compartment$new(name='newHost', unsampled=TRUE)
hostN$set.type(host1$get.type())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.