get_flows.Rd
This accessor extract flow data from an epiflows
object. get_flows
is a generic with a method defined for
epiflows
objects.
get_flows(x, ...) # S3 method for epiflows get_flows(x, from = NULL, to = NULL, all = FALSE, ...)
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". |
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
get_n()
;
For location metadata: get_locations()
; get_vars()
, get_pop_size()
, get_coordinates()
data("Brazil_epiflows") head(get_flows(Brazil_epiflows))#> from to n #> 1 Espirito Santo Italy 2827.572 #> 2 Minas Gerais Italy 15714.103 #> 3 Rio de Janeiro Italy 8163.938 #> 4 Sao Paulo Italy 34038.681 #> 5 Southeast Brazil Italy 76281.763 #> 6 Espirito Santo Spain 3270.500get_flows(Brazil_epiflows, from = "Minas Gerais")#> from to n #> 2 Minas Gerais Italy 15714.103 #> 7 Minas Gerais Spain 18175.655 #> 12 Minas Gerais Portugal 18140.543 #> 17 Minas Gerais Germany 10546.202 #> 22 Minas Gerais United Kingdom 11034.228 #> 27 Minas Gerais United States of America 75566.853 #> 32 Minas Gerais Argentina 32782.895 #> 37 Minas Gerais Chile 15528.462 #> 42 Minas Gerais Uruguay 14613.472 #> 47 Minas Gerais Paraguay 6470.791get_flows(Brazil_epiflows, to = "Minas Gerais")#> from to n #> 61 Italy Minas Gerais 9196.588 #> 62 Spain Minas Gerais 6875.487 #> 63 Portugal Minas Gerais 7388.819 #> 64 Germany Minas Gerais 10222.433 #> 65 United Kingdom Minas Gerais 8616.336 #> 66 United States of America Minas Gerais 26212.701 #> 67 Argentina Minas Gerais 94682.455 #> 68 Chile Minas Gerais 13945.500 #> 69 Uruguay Minas Gerais 12169.597 #> 70 Paraguay Minas Gerais 13740.640get_flows(Brazil_epiflows, from = "Italy", to = "Minas Gerais")#> from to n #> 61 Italy Minas Gerais 9196.588