Skip to contents

Creates a leaflet map from a data frame which contains spatial codes.

Usage

nuts_map(x, join_by = NULL, color = NULL, cutoff = 0.9, overlay_nuts2 = TRUE)

Arguments

x

a data frame

join_by

a column name. This column should contain region codes

color

a column name which contains numeric values for coloring

cutoff

percentile to cutoff the color scale. Defaults to 90%

overlay_nuts2

show nuts2 boundaries in the map?

Examples

library(sf)

## visualize population

nuts_map(iso3_pop())
nuts_map(iso5_pop())
nuts_map(nuts2_earnings(), color = "employees")
library(dplyr) merge(iso5_pop(), iso5_migration()) %>% mutate(migration_rel = in_migration/pop) %>% nuts_map(color = "migration_rel")
merge(iso3_pop(), iso3_deaths()) %>% mutate(deaths_rel = deaths/pop) %>% nuts_map(color = "deaths_rel")