Lineage: Lineage

LineageR Documentation

Lineage

Description

Lineage is an R6 class for objects that represent pathogen lineages that are carried by Compartments and which comprise the "inner" tree of the simulation.

Methods

Public methods


Method new()

Usage
Lineage$new(name = NA, type = NA, sampling.time = NA, location = NA)

Method copy()

Usage
Lineage$copy(deep = FALSE)

Method get.name()

Usage
Lineage$get.name()

Method get.type()

Usage
Lineage$get.type()

Method get.sampling.time()

Usage
Lineage$get.sampling.time()

Method get.location()

Usage
Lineage$get.location()

Method set.location()

Usage
Lineage$set.location(comp)

Method set.location.by.name()

Usage
Lineage$set.location.by.name(locationList, new.locationName)

Method clone()

The objects of this class are cloneable with this method.

Usage
Lineage$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

# 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 Lineage in first Compartment
comp <- mod$get.compartments()[[1]]
comp$get.lineages()  # display all 3 lineages

# manually add an unsampled Lineage
lin <- Lineage$new(name="L0", location=comp)
comp$add.lineage(lin)



PoonLab/twt documentation built on Nov. 7, 2024, 4:18 a.m.