subset_clusters_by_id: Subset epicontacts by case-specified clusters

Description Usage Arguments Value Author(s) Examples

View source: R/subset_clusters_by_id.R

Description

This function subsets an epicontacts object by identifying clusters of cases connected to specified cases.

Usage

1

Arguments

x

an epicontacts object

id

a character vector of case identifiers; the connected components attached to these cases will be retained in the output object.

Value

An epicontacts object whose contact dataframe corresponds to all clusters containing specified case id.

Author(s)

Nistara Randhawa ([email protected])

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
if (require(outbreaks)) {
## build data
x <- make_epicontacts(ebola_sim$linelist, ebola_sim$contacts,
                       id="case_id", to="case_id", from="infector",
                       directed=TRUE)


id <- "cac51e" ## it can be a vector of id as well


## subset based on cluster to which "cac51e" belongs
x_subset <- subset_clusters_by_id(x, id)

}

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