Contacts-class {EpiContactTrace} | R Documentation |
Class "Contacts"
Description
Class to handle contacts.
Details
The Contacts
class keeps track of all ingoing or outgoing
livstock transfers in the contact chain for a specific root within
the time window used for contact tracing. The slots;
source
, destination
, t
, id
, n
and category
contains contact information extracted from
the movement dataset during contact tracing. The index
slot
is an index to the extracted contacts within the class that
together with the distance
slot can be used to rebuild the
exact contacts that were extracted from each search step during
the contact tracing.
Slots
root
A
character
vector of length one with the identifier of the root.tBegin
A
Date
vector of length one with the start date of the time window used for contact tracing.tEnd
A
Date
vector of length one with the end date of the time window used for contact tracing.source
A
character
vector with the identifiers of the source holdings of the livestock transfer.destination
A
character
vector with the identifier of the destination holdings of the livestock transfer.t
A
Date
vector of the livestock transfer.id
A
character
vector with the identifiers of the animals.n
A
numeric
vector with the number of animals transfered.category
A
character
vector with the category of animals e.g. cattle.index
A
integer
index vector.distance
A
integer
vector with the distance from root for the contact[index]direction
A
character
vector of length one equal to the direction "in" or "out"
Objects from the Class
Objects can be created by calls
of the form new("Contacts", root, startDate, days,
source, destination, t, id, n, category, level, direction,
...)
.
Examples
## Load data
data(transfers)
## Perform contact tracing
contactTrace <- Trace(movements = transfers,
root = 2645,
tEnd = "2005-10-31",
days = 90)
## Show structure of ingoing contacts
str(contactTrace@ingoingContacts)
## Show structure of ougoing contacts
str(contactTrace@outgoingContacts)