Learn R Programming

epiflows (version 0.2.2)

get_n: get the number of cases per flow

Description

This convenience function will return a named vector containing the number of cases flowing to or from a given region.

Usage

get_n(x, from = NULL, to = NULL, ...)

# S3 method for epiflows get_n(x, from = NULL, to = NULL, ...)

Value

a character vector

Arguments

x

an epiflows object

from

a character vector of length one specifying the location from which the flows originate

to

a character vector of length one specifying the location to which the flows terminate

...

unused

Details

There are three possible outputs of this function:

  • no options specified: an un-named vector, equivalent to get_flows(x)$n

  • from = X: a named vector of cases flowing from X

  • to = X: a named vector of cases flowing to X

See Also

get_flows(); For location metadata: get_vars(), get_pop_size(), get_coordinates()

Examples

Run this code
data(Brazil_epiflows)
get_n(Brazil_epiflows, from = "Espirito Santo")
get_n(Brazil_epiflows, to   = "Espirito Santo")

Run the code above in your browser using DataLab