outbreaker_data {outbreaker2} | R Documentation |
Process input data for outbreaker
Description
This function performs various checks on input data given to outbreaker. It takes a list of named items as input, performs various checks, set defaults where arguments are missing, and return a correct list of data input. If no input is given, it returns the default settings.
Usage
outbreaker_data(..., data = list(...))
Arguments
... |
a list of data items to be processed (see description) |
data |
optionally, an existing list of data item as returned by |
Details
Acceptables arguments for ... are:
- dates
dates a vector indicating the collection dates, provided either as integer numbers or in a usual date format such as
Date
orPOSIXct
format. By convention, zero will indicate the oldest date. If the vector is named, the vector names will be used for matching cases to contact tracing data and labelled DNA sequences.- dna
the DNA sequences in
DNAbin
format (seeread.dna
in the ape package); this can be imported from a fasta file (extension .fa, .fas, or .fasta) usingadegenet
's function fasta2DNAbin.- ctd
the contact tracing data provided as a matrix/dataframe of two columns, indicating a reported contact between the two individuals whose ids are provided in a given row of the data, or an epicontacts object. In the case of the latter, linelist IDs will be used for matching dates and DNA sequences
- w_dens
a vector of numeric values indicating the generation time distribution, reflecting the infectious potential of a case t = 1, 2, ... time steps after infection. By convention, it is assumed that newly infected patients cannot see new infections on the same time step. If not standardized, this distribution is rescaled to sum to 1.
- f_dens
similar to
w_dens
, except that this is the distribution of the colonization time, i_e. time interval during which the pathogen can be sampled from the patient.
Author(s)
Thibaut Jombart (thibautjombart@gmail.com)
Examples
x <- fake_outbreak
outbreaker_data(dates = x$sample, dna = x$dna, w_dens = x$w)