-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path08-EJPolicyAltE.Rmd
133 lines (119 loc) · 9.64 KB
/
08-EJPolicyAltE.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 E - Modify Minority25 Criterion by Income125
This Alternative Environmental Justice Policy E option adds a modifier to the minority criterion. Specifically, block groups qualify for environmental justice status by minority only if the median income of the block group does not exceed 125% of the statewide median or \$92,708.75.
Under this Alternative Environmental Justice Policy E policy alternative, 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*
* 25 percent or more of the residents are minority *AND the median annual household income does not exceed 125 percent of the statewide median income for Massachusetts*; *or*
* 25 percent or more of the residents are lacking English language proficiency.
Compared to the benchmark 2010 environmental justice community criteria, the income-modified criteria of this alternative policy reduces the number of block groups qualifying as an environmental justice community by `r {sum(blkgrp_shp_WGS84$LOSEJ_m25inc125)}`, from `r {sum(blkgrp_shp_WGS84$CRITCNT2010 > 0)}` to `r {sum(blkgrp_shp_WGS84$CRITCNT_m25inc125 > 0)}` in total. Under this Environmental Justice Alternative Environmental Justice Policy E alternative policy, `r {round(sum(blkgrp_shp_WGS84$CRITCNT_m25inc125 > 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:treemapAltE) below, which shows the percentage of block groups that fall into each category or combination of environmental justice criteria.
```{r treemapAltE, echo=FALSE, message=FALSE, warning=FALSE, fig.align = "center", fig.cap="Tree map of block groups classified as environmental justice by Alternative Environmental Justice Policy E - Modify Minority Criteria by Income."}
# 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_m25inc125 = case_when(EJCRIT_m25inc125 == "E" ~ "English Isolation",
EJCRIT_m25inc125 == "E M" ~ "Minority and English Isolation",
EJCRIT_m25inc125 == "E I" ~ "Income and English Isolation",
EJCRIT_m25inc125 == "E I M" ~ "Minority, Income, and English Isolation",
EJCRIT_m25inc125 == "I" ~ "Income",
EJCRIT_m25inc125 == "I M" ~ "Minority and Income",
EJCRIT_m25inc125 == "M" ~ "Minority",
EJCRIT_m25inc125 == "" ~ "Not EJ")) %>%
group_by(EJCRIT_m25inc125) %>%
summarize(blkgrps = n()) %>%
mutate(percent = blkgrps/sum(blkgrps)*100) %>%
ggplot(aes(area = percent, fill=EJCRIT_m25inc125, label = paste(EJCRIT_m25inc125,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 Environmental Justice Policy E 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 layer button (white box in the upper right of the map) and activate the Lost EJ Policy E layer in the map to see the block groups that are delisted (i.e. "Lost") as environmental justice communities under Alternative Environmental Justice Policy E, shown as light red or salmon colored polygons.
```{r mapAltE, echo=FALSE, message=FALSE, warning=FALSE, fig.cap="Map of block groups classified as environmental justice by Alternative Environmental Justice Policy E."}
# How many lost EJ blockgroups occur within blue communities?
lostm25125 <- blkgrp_shp_WGS84 %>%
as.data.frame() %>%
group_by(TOWN) %>%
summarize(lost = sum(LOSEJ_m25inc125)) %>%
left_join(macosub_shp_WGS84,.,by=c("TOWN" = "TOWN"))
# Create map of Alternative Environmental Justice Policy E Alternative EJ Policy polygons across state
# create df without "" in EJCRIT2010 for setting up color palette
blkgrp_shp_WGS84_naEJCRIT_m25inc125 <- blkgrp_shp_WGS84 %>%
select(NAME,TOWN,EJCRIT_m25inc125,pctminority,medhhincE,pctlimitenghh) %>%
filter(EJCRIT_m25inc125 !="")
# How many EJ blockgroups still within blue communities?
insidem25125 <- blkgrp_shp_WGS84_naEJCRIT_m25inc125 %>%
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
policyEpolygons <- blkgrp_shp_WGS84 %>%
filter(LOSEJ_m25inc125 == 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!
EJEPopUp <- paste0(blkgrp_shp_WGS84_naEJCRIT_m25inc125$NAME, "<br/>",
"<b>Town:</b> ", blkgrp_shp_WGS84_naEJCRIT_m25inc125$TOWN, "<br/>",
"<b>Policy E EJ Criteria Met:</b> ", blkgrp_shp_WGS84_naEJCRIT_m25inc125$EJCRIT_m25inc125, "<br/>",
"<b>ACS 5yr 2017</b> ", "<br/>",
"<b>% Minority: </b>", round(blkgrp_shp_WGS84_naEJCRIT_m25inc125$pctminority,1),"<br/>",
"<b>Median Household Income: </b>", paste0("$",round(blkgrp_shp_WGS84_naEJCRIT_m25inc125$medhhincE)),"<br/>",
"<b>% Limited English Households: </b>", round(blkgrp_shp_WGS84_naEJCRIT_m25inc125$pctlimitenghh,1))
# draw the map of EJ Polygons according to Alternative Environmental Justice Policy E EJ Policy. Faded red/salmong colored polygons represent blockgroups that lose EJ status when the income criteria modifies minority and English isolation.
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 = policyEpolygons,
fillColor = "red",
weight = 1,
opacity = 1,
color = "yellow",
dashArray = 3,
fillOpacity = 0.3,
label=~TOWN,
popup = "Lost EJ Under Policy E",
group = "Lost EJ Policy E") %>%
addPolygons(data = blkgrp_shp_WGS84_naEJCRIT_m25inc125,
fillColor = ~EJ2010pal(EJCRIT_m25inc125),
weight = 0.5,
opacity = 0.7,
color = "white",
dashArray = 3,
fillOpacity = 0.7,
label=~TOWN,
popup = EJEPopUp,
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 E","Top 20% Median Household Income"),
options = layersControlOptions(collapsed = TRUE)
) %>%
hideGroup(c("Top 20% Median Household Income", "Lost EJ Policy E"))
```
Another way to evaluate the impact of Alternative Environmental Justice Policy E is to look at how many "lost" environmental justice classifications occur within wealthier municipalities. Under Alternative Environmental Justice Policy E, `r {sum(lostm25125$lost)}` (`r {round(sum(lostm25125$lost) / sum(blkgrp_shp_WGS84$LOSEJ_m25inc125) * 100,1)}`%) of the `r {sum(blkgrp_shp_WGS84$LOSEJ_m25inc125)}` lost environmental justice classifications occur in these highest income municipalities. Conversely, `r {sum(insidem25125$inside)}` (`r {round(sum(insidem25125$inside)/sum(blkgrp_shp_WGS84$CRITCNT_m25inc125 > 0)*100,1)}`%) 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.