get_n.Rd
This convenience function will return a named vector containing the number of cases flowing to or from a given region.
get_n(x, from = NULL, to = NULL, ...) # S3 method for epiflows get_n(x, from = NULL, to = NULL, ...)
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 |
a character vector
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
get_flows()
;
For location metadata: get_vars()
, get_pop_size()
, get_coordinates()
data(Brazil_epiflows) get_n(Brazil_epiflows, from = "Espirito Santo")#> Italy Spain Portugal #> 2827.572 3270.500 3264.182 #> Germany United Kingdom United States of America #> 1897.668 1985.482 13597.386 #> Argentina Chile Uruguay #> 5898.905 2794.168 2629.526 #> Paraguay #> 1164.344get_n(Brazil_epiflows, to = "Espirito Santo")#> Italy Spain Portugal #> 1566.257 1170.954 1258.379 #> Germany United Kingdom United States of America #> 1740.967 1467.435 4464.246 #> Argentina Chile Uruguay #> 16125.229 2375.037 2072.586 #> Paraguay #> 2340.148