thin: Thin data to retain matching linelist / contacts

Description Usage Arguments Author(s) Examples

View source: R/thin.R

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

1
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(s)

Thibaut Jombart ([email protected])

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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"]

}

epicontacts documentation built on May 2, 2019, 11:29 a.m.