get_flows {epiflows} | R Documentation |
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 class 'epiflows'
get_flows(x, from = NULL, to = NULL, all = FALSE, ...)
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". |
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
Author(s)
Zhian N. Kamvar
See Also
get_n()
;
For location metadata: get_locations()
; get_vars()
, get_pop_size()
, get_coordinates()
Examples
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")
[Package epiflows version 0.2.1 Index]