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")

Arguments

x

An epicontacts object.

what

A character string or integer determining which type of data is removed ('thinned'). "linelist" / 1 indicates that only cases appearing in $contacts are kept in $linelist. "contacts / 2" indicates that only cases appearing in $linelist are kept in $contacts.

Author

Thibaut Jombart (thibautjombart@gmail.com)

Examples

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"] }