## Load data
data(transfers)
## Perform contact tracing using tEnd and days
contactTrace <- Trace(movements=transfers,
root=2645,
tEnd='2005-10-31',
days=91)
## Calculate outgoing contact chain from a ContactTrace object
oc.1 <- OutgoingContactChain(contactTrace)
## Calculate outgoing contact chain using tEnd and days
oc.2 <- OutgoingContactChain(transfers,
root=2645,
tEnd='2005-10-31',
days=91)
## Check that the result is identical
identical(oc.1, oc.2)
## Calculate outgoing contact chain for all included herds
## First extract all source and destination from the dataset
root <- sort(unique(c(transfers$source,
transfers$destination)))
## Calculate outgoing contact chain
result <- OutgoingContactChain(transfers,
root=root,
tEnd='2005-10-31',
days=91)
Run the code above in your browser using DataLab