This function can be used to remove ('thin') data from
epicontacts
objects to ensure stricter matching of linelists
and contacts. It has two behaviours, triggered by the argument what
:
either it thins data from $linelist
, keeping only cases that are in
$contacts
(thin = "linelist"
, default), or the converse,
i.e. removing contacts which are not fully documented in the linelist.
thin(x, what = "linelist")
x | An |
---|---|
what | A character string or integer determining which type of data is
removed ('thinned'). "linelist" / 1 indicates that only cases appearing
in |
Thibaut Jombart (thibautjombart@gmail.com)
if (require(outbreaks)) { ## build data x <- make_epicontacts(ebola_sim$linelist, ebola_sim$contacts, id = "case_id", to = "case_id", from = "infector", directed = TRUE) ## keep contacts from a specific case '916d0a' x <- x[j = "916d0a", contacts = "from"] }