[.epiflows {epiflows}R Documentation

Subset 'epiflows' objects

Description

An epiflows object inherits the epicontacts class, so the subsetting mechanism is also inherited. The benefits is that it's extremely flexible. However, this also means that it's possible for the contacts to contain IDs that are not present in the locations metadata and vice versa. The best way to consistently subset an epiflows object is present in the examples.

Usage

## S3 method for class 'epiflows'
x[i, j, k = TRUE, l = TRUE, ...]

Arguments

x

An epiflows object.

i

An integer, logical, or character vector of one or more location.

j

An integer, logical, or character vector to subset the flows data frame.

k

A character vector of one or more columns to be retained in the location data.

l

A character vector of one or more columns to be retained in the flows data frame. Note: if using numbers, the first column stands for the first column after "n".

...

Additional parameters passed to [.epicontacts.

Details

Returns a subset of an epiflows object.

Value

An epiflows object.

Author(s)

Zhian N. Kamvar

Examples

data(Brazil_epiflows)
# You can subset, but the flows information will still be present
Brazil_epiflows[j = "Espirito Santo"]
# To help with this, use `thin` from epiflows
epicontacts::thin(Brazil_epiflows[j = "Espirito Santo"])
epicontacts::thin(Brazil_epiflows[j = c("Espirito Santo", "Rio de Jenerio")])


[Package epiflows version 0.2.1 Index]