## 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
trace_1
## Create a network summary for 10 of the included herds
## First extract all source and destination from the dataset,
## then select the first ten.
root <- sort(unique(c(transfers$source,
transfers$destination)))
root <- root[1:10]
## 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)
Run the code above in your browser using DataLab