if (FALSE) {
## 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