Skip to content

Commit

Permalink
change food insecurity % map color, add NA to legend
Browse files Browse the repository at this point in the history
  • Loading branch information
amd112 committed May 22, 2024
1 parent eb21657 commit 1d049bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions code/06_create_2023_food_insecurity_map.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ new_food_security_data = read_csv(file.path("data", "input", "Neighborhood Prior


################################################################################
# calculate change over different NTA shapes
# calculate change for different NTA shapes
################################################################################

nta_2010_pop = fromJSON("https://data.cityofnewyork.us/resource/rnsn-acs2.json") %>%
Expand Down Expand Up @@ -84,7 +84,7 @@ d = c(min(nta_2020$food_insecurity_2023, na.rm=T),

quantile(nta_2020$food_insecurity_2023, c(0, .2, .4, .6, .8, 1), na.rm=T)*100
pal = colorBin(
palette = pal_nycc("cool"),
palette = pal_nycc("warm"),
bins = c(.05, .09, .14, .18, .35),
domain = d,
na.color = "grey"
Expand Down Expand Up @@ -117,15 +117,15 @@ map = leaflet() %>%
group = "% food insecure 2023") %>%
addCouncilStyle(add_dists = F) %>%
addLegend_decreasing(position = "topleft", pal = pal,
values = community_districts$perc_snap_cur,
values = nta_2020$food_insecurity_2023,
title = paste0("% food insecure by <br>",
"Neighborhood Tabulation Area"),
labFormat = labelFormat(suffix = "%",
transform = function(x){x*100}),
opacity = 1, decreasing = T,
group = "% food insecure 2023") %>%
addLegend_decreasing(position = "topleft", pal = pal2,
values = community_districts$perc_point_change_snap,
values = nta_2020$perc_point_change_food_insecurity,
title = paste0("% point change in food insecurity <br>",
"from 2018 to 2023"),
labFormat = labelFormat(suffix = "%"),
Expand Down
6 changes: 3 additions & 3 deletions visuals/percent_individuals_food_insecure.html

Large diffs are not rendered by default.

0 comments on commit 1d049bc

Please sign in to comment.