## 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