Creation Code and Resulting Map:
bins1 <- c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
pal1 <- colorBin("Greens", domain = MapData1$Rank, bins = bins1)
g <- leaflet(data = MapData1) |>
#setView(-96, 37.8, 4) |>
addTiles() |>
addPolygons(
fillColor = ~pal1(Rank),
weight = 2,
opacity = 1,
color = "white",
fillOpacity = 0.7
) |>
addLegend(
pal = pal1,
values = ~Rank,
opacity = 0.7,
title = 'Health Outcome Rank',
position = "bottomright"
)
g