Learn R Programming

epiflows (version 0.2.1)

get_flows: Access flow data

Description

This accessor extract flow data from an epiflows object. get_flows is a generic with a method defined for epiflows objects.

Usage

get_flows(x, ...)

# S3 method for epiflows get_flows(x, from = NULL, to = NULL, all = FALSE, ...)

Value

A data.frame with 3 columns:

  • from: origin of the flow

  • to: destination of the flow

  • n: magnitude of the flow---can be a number of passengers per unit of time, a rate, a probability of migration

Arguments

x

An `epiflows` object.

...

unused

from

a character string defining which regions should be included in the flows

to

a character string defining which regions should be included in the flows

all

when `TRUE`, all the columns of the flows data frame will be returned. Defaults to `FALSE`, which returns "from", "to", and "n".

Author

Zhian N. Kamvar

See Also

get_n(); For location metadata: get_locations(); get_vars(), get_pop_size(), get_coordinates()

Examples

Run this code
data("Brazil_epiflows")
head(get_flows(Brazil_epiflows))
get_flows(Brazil_epiflows, from = "Minas Gerais")
get_flows(Brazil_epiflows, to = "Minas Gerais")
get_flows(Brazil_epiflows, from = "Italy", to = "Minas Gerais")

Run the code above in your browser using DataLab