make_dibbler: Process input data for dibbler

Description Usage Arguments Value Author(s) Examples

Description

This function combines data of a food distribution network (including cases as terminal nodes) and additional information on the nodes (typically a linelist) to create a dibbler object. The S3 class dibbler is an extension of the epicontacts objects implemented in the similarly named package.

Usage

1
make_dibbler(net, nodes_data, from = 1L, to = 2L, id = 1L)

Arguments

net

A data.frame defining the edges of the food distribution network with at least two columns representing source and receiver nodes (i.e., 'from' and 'to'). This network is meant to include cases, which will be seen as terminal nodes. Labels used in these columns will be matched against nodes_data. Other columns are optional and will be kept as edge attributes.

nodes_data

A data.frame containing additional information on the nodes of the network. Typically, this will be a linelist providing data on the reported cases.

from

An integer or character string indicating the column in net containing source nodes ('from' column).

to

An integer or character string indicating the column in net containing receiving nodes ('to' column).

id

An integer or character string indicating the column in nodes_data containing unique case identifiers. These will be matched against the nodes of the network described in net.

Value

a list of data suitable for input for dibbler

Author(s)

Thibaut Jombart thibautjombart@gmail.com

Examples

1
2
3
4
5
6
7
8
9
if (require(outbreaks)) {

  v_data <- s_enteritidis_pt59$graph
  n_data <- data.frame(id = names(s_enteritidis_pt59$cluster),
                       cluster = s_enteritidis_pt59$cluster)

  x <- make_dibbler(v_data, n_data)
  x
}

thibautjombart/dibbler documentation built on May 31, 2019, 9:56 a.m.