Introduction
In this exercise, health data was downloaded from Washington State
Department of Health to create maps showing social determinants of
health and health outcomes.
Mapping Social Determinants of health by census tract
# Code to create map of social determinant data
pal2 <- colorNumeric("Reds", domain = SocialOutcomesData$Ranks, 1:10)
g <- leaflet(data = SocialOutcomesData) |>
setView(-120, 47.75, 6) |>
addTiles() |>
addPolygons(
fillColor = ~pal2(Ranks),
weight = 2,
opacity = 1,
color = "white",
fillOpacity = 0.7
) |>
addLegend(
pal = pal2,
values = ~Ranks,
opacity = 0.7,
title = 'Social Determinants Rank',
position = "bottomright"
)
g