map_world: map_world

Description Usage Arguments Value

View source: R/choropleth.R

Description

Choropleth map of the world on country level

Usage

1
2
map_world(dat, return_df = FALSE, vars = "n", country_nchar = 2,
  map_provider = "CartoDB.Positron")

Arguments

dat

tibble, containing country (2-letter country codes, or 3-letter codes, depending on country_nchar), numeric variable(s) to be plotted and label (to be shown in hoverlabel)

return_df

#Boolean, whether to return table of results in addition to a plot (as a list)

vars

vector of variables to include, possibly named. If more than one, will add layer control, using vector names.

country_nchar

2 or 3, how to interpret the country values in dat: as 2- or 3-letter codes

map_provider

provider of maptiles (see leaflet documentation). NULL will use leaflet default.

Value

leaflet object, or a list of a leaflet object and a tibble, depending on return_df


rushkin/bitsandends documentation built on Oct. 21, 2020, 11:43 a.m.