get_trees {o2ools}R Documentation

Extract posterior transmission trees

Description

Generates a list of data frames representing posterior transmission trees from an outbreaker_chains object. Each tree contains 'from' and 'to' columns, and may optionally include kappa, t_inf, and user-supplied columns.

Usage

get_trees(out, kappa = FALSE, t_inf = FALSE, ...)

Arguments

out

A data frame of class outbreaker_chains.

kappa

Logical. If TRUE, includes kappa values in the output. Default is FALSE.

t_inf

Logical. If TRUE, includes infection times (t_inf) in the output. Default is FALSE.

...

Additional vectors to include as columns in the output. Must be given in the same order as used in outbreaker().

Value

A list of data frames, one per posterior sample. Each data frame has at least 'from' and 'to' columns.

Examples

get_trees(out, id = linelist$id,
               name = linelist$name,
               group = linelist$group,
               onset = linelist$onset)

[Package o2ools version 0.0.1 Index]