outbreaker_chains: Basic methods for processing outbreaker results

print.outbreaker_chainsR Documentation

Basic methods for processing outbreaker results


Several methods are defined for instances of the class outbreaker_chains, returned by outbreaker, including: print, plot, summary


## S3 method for class 'outbreaker_chains'
print(x, n_row = 3, n_col = 8, ...)

## S3 method for class 'outbreaker_chains'
  y = "post",
  type = c("trace", "hist", "density", "alpha", "t_inf", "kappa", "network"),
  group = NULL,
  burnin = 0,
  min_support = 0.1,
  labels = NULL,

## S3 method for class 'outbreaker_chains'
summary(object, burnin = 0, method = c("mpa", "decycle"), ...)



an outbreaker_chains object as returned by outbreaker.


the number of rows to display in head and tail; defaults to 3.


the number of columns to display; defaults to 8.


further arguments to be passed to other methods


a character string indicating which element of an outbreaker_chains object to plot


a character string indicating the kind of plot to be used (see details)


a vector of character strings indicating the parameters to display, or "all" to display all global parameters (non node-specific parameters).


the number of iterations to be discarded as burnin


a number between 0 and 1 indicating the minimum support of ancestries to be plotted; only used if 'type' is 'network'


a vector of length N indicating the case labels (must be provided in the same order used for dates of symptom onset)


an outbreaker_chains object as returned by outbreaker.


the method used to determine consensus ancestries. 'mpa' (maximum posterior ancestry) simply returns the posterior ancestry with the highest posterior support for each case, even if this includes cycles. 'decycle' will return the maximum posterior ancestry, except when cycles are detected, in which case the link in the cycle with the lowest support is pruned and the tree recalculated.


type indicates the type of graphic to plot:

  • trace to visualise MCMC traces for parameters or augmented data (plots the log-likelihood by default)

  • hist to plot histograms of quantitative values

  • density to plot kernel density estimations of quantitative values

  • alpha to visualise the posterior frequency of ancestries

  • network to visualise the transmission tree; note that this opens up an interactive plot and requires a web browser with Javascript enabled; the argument 'min_support' is useful to select only the most supported ancestries and avoid displaying too many links

  • kappa to visualise the distributions generations between cases and their ancestor/infector


Thibaut Jombart (thibautjombart@gmail.com)

See Also

See introduction vignette for detailed examples on how to visualise outbreaker_chains objects.

outbreaker2 documentation built on May 23, 2022, 5:06 p.m.