-
Notifications
You must be signed in to change notification settings - Fork 0
/
05-EJPolicyAltB.Rmd
133 lines (119 loc) · 9.08 KB
/
05-EJPolicyAltB.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Environmental Justice Alternative Policy B - Increase Minority Percentage to 50
According to the ACS 1 year 2018 estimate for Massachusetts, minorities make up 27.8% of the population in Massachusetts. We can use that number as a starting point and roughly double it up to 50%.
Under Alternative Environmental Justice Policy B option, environmental justice communities are defined as neighborhoods (U.S. Census Bureau census block groups) that meet *one or more* of the following criteria:
* The median annual household income is at or below 65 percent of the statewide median income for Massachusetts; *or*
* *50 percent or more of the residents are minority*; *or*
* 25 percent or more of the residents are lacking English language proficiency.
Compared to the minority threshold of 25%, the 50% threshold for the Minority criterion reduces the number of block groups qualifying as an environmental justice community by `r {sum(blkgrp_shp_WGS84$LOSEJ_min50)}`, from `r {sum(blkgrp_shp_WGS84$CRITCNT2010 > 0)}` to `r {sum(blkgrp_shp_WGS84$CRITCNT_min50 > 0)}` in total. Under this Environmental Justice Alternative Policy B, `r {round(sum(blkgrp_shp_WGS84$CRITCNT_min50 > 0) / nrow(blkgrp_shp_WGS84) * 100,1)}`% of Massachusetts block groups are classified as environmental justice communities. This classification can be visualized in Figure \@ref(fig:treemapAltB) below, which shows the percentage of block groups that fall into each category or combination of environmental justice criteria.
```{r treemapAltB, echo=FALSE, message=FALSE, warning=FALSE, fig.align = "center", fig.cap="Tree map of block groups classified as environmental justice by Alternative EJ Policy B - Increase Minority Percentage to 50."}
# Create a tree map instead with treemapify
# library(treemapify)
# First, you need to generate a summary df with one value per observation or EJ criterion
blkgrp_shp_WGS84 %>%
mutate(EJCRIT_min50 = case_when(EJCRIT_min50 == "E" ~ "English Isolation",
EJCRIT_min50 == "E M" ~ "Minority and English Isolation",
EJCRIT_min50 == "E I" ~ "Income and English Isolation",
EJCRIT_min50 == "E I M" ~ "Minority, Income, and English Isolation",
EJCRIT_min50 == "I" ~ "Income",
EJCRIT_min50 == "I M" ~ "Minority and Income",
EJCRIT_min50 == "M" ~ "Minority",
EJCRIT_min50 == "" ~ "Not EJ")) %>%
group_by(EJCRIT_min50) %>%
summarize(blkgrps = n()) %>%
mutate(percent = blkgrps/sum(blkgrps)*100) %>%
ggplot(aes(area = percent, fill=EJCRIT_min50, label = paste(EJCRIT_min50,paste(round(percent,1),"%"),sep="\n"))) +
scale_fill_manual(name = "Environmental Justice Criteria",
values = c("lightskyblue","lawngreen","cyan","gold","deeppink","darkgreen","navyblue","gray88")) +
labs(title = "Massachusetts Census Blockgroups Meeting Alternative EJ Policy B Criteria",
caption = "Based on ACS 5yr 2017 Blockgroup Estimates") +
geom_treemap() +
geom_treemap_text(color = "white", place = "centre", grow = TRUE)
```
These classifications can be visualized and explored geographically in the interactive map below. Click on the search tool (white box in upper left of map) and type in a town or city name to zoom to that municipality. Click on individual block groups to see more detailed demographics. Click on the layers button (white box in the upper right of the map) and activate the Lost EJ Policy B layer in the map to see the block groups that are delisted (i.e. "Lost") as environmental justice communities under Policy B, shown as light red or salmon colored polygons.
```{r echo=FALSE, message=FALSE, warning=FALSE, fig.cap="Map of block groups classified as environmental justice by Alternative Environmental Justice Policy B."}
# How many lost EJ blockgroups occur within blue communities?
lost50 <- blkgrp_shp_WGS84 %>%
as.data.frame() %>%
group_by(TOWN) %>%
summarize(lost = sum(LOSEJ_min50)) %>%
left_join(macosub_shp_WGS84,.,by=c("TOWN" = "TOWN"))
# Create map of Alternative EJ Policy B polygons across state
# create df without "" in EJCRIT2010 for setting up color palette
blkgrp_shp_WGS84_naEJCRIT_min50 <- blkgrp_shp_WGS84 %>%
select(NAME,TOWN,EJCRIT_min50,pctminority,medhhincE,pctlimitenghh) %>%
filter(EJCRIT_min50 !="")
# How many EJ blockgroups still within blue communities?
inside50 <- blkgrp_shp_WGS84_naEJCRIT_min50 %>%
as.data.frame() %>%
group_by(TOWN) %>%
summarize(inside = n()) %>%
left_join(macosub_shp_WGS84,.,by=c("TOWN" = "TOWN")) %>%
na.omit()
# create a polygon layer of blockgroups that are dropped out of EJ status by criteria change
policyBpolygons <- blkgrp_shp_WGS84 %>%
filter(LOSEJ_min50 == TRUE) %>%
select(TOWN)
# Create popup. NOTE THAT POPUP AND PALETTE MUST BE CREATED FROM EXACT SAME DF AS USED IN leaflet() MAP. OTHERWISE, POPUPS WILL SHOW UP IN THE WRONG LOCATION!
EJBPopUp <- paste0(blkgrp_shp_WGS84_naEJCRIT_min50$NAME, "<br/>",
"<b>Town:</b> ", blkgrp_shp_WGS84_naEJCRIT_min50$TOWN, "<br/>",
"<b>Policy B EJ Criteria Met:</b> ", blkgrp_shp_WGS84_naEJCRIT_min50$EJCRIT_min50, "<br/>",
"<b>ACS 5yr 2017</b> ", "<br/>",
"<b>% Minority: </b>", round(blkgrp_shp_WGS84_naEJCRIT_min50$pctminority,1),"<br/>",
"<b>Median Household Income: </b>", paste0("$",round(blkgrp_shp_WGS84_naEJCRIT_min50$medhhincE)),"<br/>",
"<b>% Limited English Households: </b>", round(blkgrp_shp_WGS84_naEJCRIT_min50$pctlimitenghh,1))
# draw the map of EJ Polygons according to EJ Policy B. Faded red/salmong colored polygons represent blockgroups that lose EJ status when the minority threshold is changed from 25% to 30%.
leaflet() %>%
addProviderTiles(providers$CartoDB.Positron) %>%
addPolygons(data = town_shp_WGS84,
weight = 0.7,
opacity = 1,
color = "gray",
fillOpacity = 0,
label=~TOWN, popup=~TOWN, group='muni') %>%
addPolygons(data = macosub_shp_WGS84,
weight = 2,
opacity = 1,
color = "blue",
fillOpacity = 0.1,
fillColor = "blue",
label = ~TOWN,popup = TownMedIncPopUp,
group = "Top 20% Median Household Income") %>%
addPolygons(data = policyBpolygons,
fillColor = "red",
weight = 1,
opacity = 1,
color = "yellow",
dashArray = 3,
fillOpacity = 0.3,
label=~TOWN,
popup = "Lost EJ Under Policy B",
group = "Lost EJ Policy B") %>%
addPolygons(data = blkgrp_shp_WGS84_naEJCRIT_min50,
fillColor = ~EJ2010pal(EJCRIT_min50),
weight = 0.5,
opacity = 0.7,
color = "white",
dashArray = 3,
fillOpacity = 0.7,
label=~TOWN,
popup = EJBPopUp,
highlight = highlightOptions(
weight = 5,
color = "#666",
dashArray = "",
fillOpacity = 0.7,
bringToFront = TRUE)) %>%
addLegend(colors = EJcolsHex,
labels = c("Minority","Income","English Isolation","Minority and Income","Minority and English Isolation","Income and English Isolation","Minority, Income, and English Isolation"), title = "Environmental Justice Populations", position = "bottomleft") %>%
setView(lng = -71.75, 42.1, zoom = 8) %>%
# addMiniMap() %>%
addScaleBar(position = "bottomright") %>%
addSearchFeatures(targetGroups = 'muni',
options = searchFeaturesOptions(zoom=14, openPopup=TRUE, hideMarkerOnCollapse=T)) %>%
addLayersControl(
overlayGroups = c("Lost EJ Policy B","Top 20% Median Household Income"),
options = layersControlOptions(collapsed = TRUE)
) %>%
hideGroup(c("Top 20% Median Household Income", "Lost EJ Policy B"))
```
Under this proposal, block groups within I-495, especially the inner communities around Boston see the largest loss of EJ status. Another way to evaluate the impact of Policy B is to look at how many "lost" environmental justice classifications occur within wealthier municipalities. Under Policy B, `r {sum(lost50$lost)}` (`r {round(sum(lost50$lost) / sum(blkgrp_shp_WGS84$LOSEJ_min50) * 100,1)}`%) of the `r {sum(blkgrp_shp_WGS84$LOSEJ_min50)}` lost environmental justice classifications occur in these highest income municipalities. Conversely, `r {sum(inside50$inside)}` (`r {round(sum(inside50$inside)/sum(blkgrp_shp_WGS84$CRITCNT_min50 > 0),3)*100}`%) of environmental justice block groups remain within these highest income municipalities. The latter addresses the issue of environmental justice designations that occur in communities not typically associated with environmental injustices. Activate the Top 20% Median Household Income layer in the map to see the municipalities in the top fifth of median household incomes (i.e. median household incomes ranging from \$105,169 to \$204,018), which are shaded in blue.