Population density changes in lowland Ethiopia

Population density changes in person per km2 in lowlands Ethiopia.

bins <- c(-100, -50, 0,  15, 50, 100, 150, 250, 280)
pal <- colorBin("PuOr", domain = df_pd$change_km2, bins = bins)
labels <- sprintf("%s , <strong>%s</strong><br/>%g person/km2",
                  df_pd$REGIONNAME, df_pd$WOREDANAME, round(df_pd$change_km2, 2)
) %>% lapply(htmltools::HTML)


m <- leaflet(df_pd) %>%
 addProviderTiles(providers$CartoDB.Positron) %>%
  setView(lng=39.296289, lat =9.150055, zoom = 6)
m %>%
  addPolygons(fillColor = ~pal(df_pd$change_km2),
              weight = 1,
              opacity = 1,
              color = "white",
              dashArray = "3",
              fillOpacity = 0.7,
              highlight = highlightOptions(
                weight = 5,
                color = "#666",
                dashArray = "",
                fillOpacity = 0.7,
                bringToFront = TRUE),
              label = labels,
              labelOptions = labelOptions(
                style = list("font-weight" = "normal", padding = "3px 8px"),
                textsize = "15px",
                direction = "auto")) %>%
  addLegend(pal = pal, values = df_pd$change_km2, opacity = 0.7, title = "Population density changes between 2000 and 2017 (person/km2)", position = "bottomright")