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 ingoing contact chain from a ContactTrace object
ic.1 <- IngoingContactChain(contactTrace)
## Calculate ingoing contact chain using tEnd and days
ic.2 <- IngoingContactChain(transfers,
root = 2645,
tEnd = "2005-10-31",
days = 91)
## Check that the result is identical
identical(ic.1, ic.2)
## Calculate ingoing contact chain for all included herds
## First extract all source and destination from the dataset
root <- sort(unique(c(transfers$source,
transfers$destination)))
## Calculate ingoing contact chain
result <- IngoingContactChain(transfers,
root = root,
tEnd = "2005-10-31",
days = 91)
}
Run the code above in your browser using DataLab