thin {epicontacts} | R Documentation |
Thin data to retain matching linelist / contacts
Description
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.
Usage
thin(x, what = "linelist")
Arguments
x |
An |
what |
A character string or integer determining which type of data is
removed ('thinned'). "linelist" / 1 indicates that only cases appearing
in |
Author(s)
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"]
}
[Package epicontacts version 1.1.4 Index]