map_epiflows: Map flows of people between locations

View source: R/map_epiflows.R

map_epiflowsR Documentation

Map flows of people between locations

Description

The function map_epiflows uses leaflet to generate an interactive map displaying flows of people travelling between locations stored in a epiflows object. Note that the object needs to possess geographic coordinates.

Usage

map_epiflows(
  x,
  title = "",
  center = NULL,
  sort = TRUE,
  pal = "YlOrBr",
  adjust_width = TRUE,
  ...
)

Arguments

x

An epiflows object.

title

Plot title.

center

An optional set of coordinates or character string specifying ID to use as the center of the map

sort

a logical. When TRUE (default), the flows will be sorted in order of number of cases on the map so that the largest flows appear on top.

pal

a color palette to pass on to leaflet::colorQuantile(). This can be the name of a viridis or RColorBrewer palette, a vector of hex colors, or a color-generating functon.

adjust_width

a logical specifying if the width of the flows should be adjusted to reflect the number of flows between locations. Defaults to TRUE.

...

Additional parameters (not used).

Value

A leaflet object

Author(s)

Paula Moraga, Pawel Piatkowski, Salla Toikkanen, Zhian Kamvar

Examples

data("Brazil_epiflows")
data("YF_coordinates")
ef <- add_coordinates(Brazil_epiflows, YF_coordinates[-1])
plot(ef)
map_epiflows(ef, center = "Espirito Santo", title = "Flows to and from Brazil")

reconhub/epiflows documentation built on Sept. 21, 2023, 1:17 p.m.