plot.Run: plot.Run

View source: R/Run.R

plot.RunR Documentation

plot.Run

Description

S3 plot method for Run objects.

Usage

## S3 method for class 'Run'
plot(run, type = "t", ...)

Arguments

run:

R6 object of class 'Run'

type:

what type of plot should be drawn. Possible types are

  • "t" for transmission tree plot

  • "s" for stair step plot of population dynamics

Details

If the Run object is the outcome of sim.outer.tree() or either of the related outer tree functions, then we call the internal function .plot.outer.tree().

If the Run object is the outcome of sim.inner.tree(), then the eventlog is converted into a Phylo object and plotted using the S3 method provided by the 'ape' package.

Examples

# load model
path <- system.file('extdata', 'SI.yaml', package='twt')

# load file and parse to construct MODEL object
settings <- yaml.load_file(path)
mod <- Model$new(settings)

# simulate outer tree
run <- sim.outer.tree(mod)

# generate plots side-by-side
par(mfrow=c(1,2))
plot(run, type='s')  # population dynamics
plot(run, type='t')  # transmission tree


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