Learn R Programming

EpiContactTrace (version 0.8.8)

Trace: Trace Contacts.

Description

Contact tracing for a specied node(s) (root) during a specfied time period. The time period is divided into two parts, one for ingoing contacts and one for outgoing contacts.

Usage

Trace(movements, root, tEnd, days, inBegin, inEnd,
    outBegin, outEnd)

Arguments

movements
a data.frame data.frame with movements, see details.
root
vector of roots to perform contact tracing for.
tEnd
the last date to include ingoing and outgoing movements. Defaults to NULL
days
the number of previous days before tEnd to include ingoing and outgoing movements. Defaults to NULL
inBegin
the first date to include ingoing movements. Defaults to NULL
inEnd
the last date to include ingoing movements. Defaults to NULL
outBegin
the first date to include outgoing movements. Defaults to NULL
outEnd
the last date to include outgoing movements. Defaults to NULL

Details

The time period used for Trace can either be specified using tEnd and days or inBegin, inEnd, outBegin and outEnd.

If using tEnd and days, the time period for ingoing and outgoing contacts ends at tEnd and starts at days prior to tEnd. The tracing will be performed for each combination of root, tEnd and days.

An alternative way is to use inBegin, inEnd, outBegin and outEnd. The time period for ingoing contacts starts at inBegin and ends at inEndDate. For outgoing contacts the time period starts at outBegin and ends at outEnd. The vectors root inBegin, inEnd, outBegin and outEnd must have the same lengths and the tracing will be performed for each index of them.

The argument movements in Trace is a data.frame with the following columns: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

References

  • Dube, C., et al., A review of network analysis terminology and its application to foot-and-mouth disease modelling and policy development. Transbound Emerg Dis 56 (2009) 73-85, doi: 10.1111/j.1865-1682.2008.01064.x
  • Noremark, M., et al., Network analysis of cattle and pig movements in Sweden: Measures relevant for disease control and riskbased surveillance. Preventive Veterinary Medicine 99 (2011) 78-90, doi: 10.1016/j.prevetmed.2010.12.009

Examples

Run this code
## Load data
data(transfers)

## Perform contact tracing using tEnd and days
trace.1 <- Trace(movements=transfers,
                 root=2645,
                 tEnd='2005-10-31',
                 days=91)

## Perform contact tracing using inBegin, inEnd
## outBegin and outEnd
trace.2 <- Trace(movements=transfers,
                 root=2645,
                 inBegin='2005-08-01',
                 inEnd='2005-10-31',
                 outBegin='2005-08-01',
                 outEnd='2005-10-31')

## Check that the result is identical
identical(trace.1, trace.2)

## Show result of contact tracing
show(trace.1)

## Create a network summary for all included herds
## First extract all source and destination from the dataset
root <- sort(unique(c(transfers$source,
                      transfers$destination)))

## Perform contact tracing using tEnd and days.
trace.3 <- Trace(movements=transfers,
                 root=root,
                 tEnd='2005-10-31',
                 days=91)

## Perform contact tracing using inBegin, inEnd
## outBegin and outEnd
trace.4 <- Trace(movements=transfers,
                 root=root,
                 inBegin=rep('2005-08-01', length(root)),
                 inEnd=rep('2005-10-31', length(root)),
                 outBegin=rep('2005-08-01', length(root)),
                 outEnd=rep('2005-10-31', length(root)))

## Check that the result is identical
identical(trace.3, trace.4)

NetworkSummary(trace.3)

Run the code above in your browser using DataLab