## DATA IMPORTS-----------------------------------------------------------------
evi_all_decades_cbg <- readRDS(paste0(wd,
green_space_path,
"evi_all_years_on_2010cbg_LONG.rds"))
evi_area_decades_cbg <- readRDS(paste0(wd,
green_space_path,
"evi_area_all_years_on_2010cbg_LONG.rds"))
race_all_decades_cbg <- readRDS(paste0(wd,
census_data_path,
"/all_years_race_on_cbg10_LONG.rds"))
housing_all_decades_cbg <- readRDS(paste0(wd,
census_data_path,
"/all_years_housing_on_cbg10_LONG.rds"))
income_all_decades_cbg <- readRDS(paste0(wd,
census_data_path,
"/all_years_income_on_cbg10_LONG.rds"))
counties <- get_decennial(geography = "county",
variables = "P001001",
year = 2010)
places <- get_decennial(geography = "place",
variables = "P001001",
year = 2010)
cbg_higher_geog_ids <- readRDS(paste0(shp_repo,
"/cbg_full_geog_identifers.rds"))
top100_cbsa <- read_csv(paste0(shp_repo,
"/top100_cbsa_2010bounds.csv"))
top100_places <- read_csv(paste0(shp_repo,
"/top100_places_2010bounds.csv"))
state_id_regions <- read_csv(paste0(shp_repo,
"/state_identifiers_census_regions.csv"))#DATA PREPARATION---------------------------------------------------------------
## MERGE ALL GEOIDs
top100_cbsa <- top100_cbsa %>%
mutate(CBSAFP = as.character(CBSAFP)) %>%
select(-CBSA_NM) %>%
rename(top100_cbsa="top_100", cbsa_rank_pop_size="rank_pop_size")
top100_places <- top100_places %>%
select(-PLACE_NM) %>%
rename(top100_place="top_100", place_rank_pop_size="rank_pop_size")
counties <- counties %>%
select(PLACEFP_DERIVED = "GEOID", PLACE_DERIVED_NM = "NAME")
cbg_all_geoids <- cbg10 %>%
st_set_geometry(NULL) %>%
select(GEOID10, GISJOIN) %>%
left_join(., cbg_higher_geog_ids, by=c("GEOID10", "GISJOIN")) %>%
mutate(PLACEFP_DERIVED = if_else(is.na(PLACEID),
str_sub(GEOID10, end=5),
PLACEID)) %>%
left_join(., counties, by = "PLACEFP_DERIVED") %>%
mutate(PLACE_DERIVED_NM=coalesce(PLACE_DERIVED_NM, PLACE_NM)) %>%
relocate(PLACEFP_DERIVED, .after=PLACEID) %>%
relocate(PLACE_DERIVED_NM, .after=PLACE_NM) %>%
left_join(., top100_places, by=c("PLACEID"="PLACEFP")) %>%
left_join(., top100_cbsa, by=c("CBSAFP10"="CBSAFP")) %>%
mutate(in_metro = if_else(str_detect(CBSA_NM, "Metro"),
"Metropolitan Area",
"Micropolitan Area")
)
## AREAL CALCULATIONS
cbg_area <- cbg10 %>%
select(GEOID10) %>%
mutate(area = st_area(.),
area = as.numeric(set_units(area, mi^2))
) %>%
st_set_geometry(NULL)
## MERGE ALL DEMOGRAPHIC & GREEN SPACE DATA
race_pct_all_decades_cbg <- race_all_decades_cbg %>%
mutate_at(vars(WHITE_NH:HISPANIC), funs("PCT" = (./TOT_POP) * 100)) %>%
select(GEOID, wave, TOT_POP, WHITE_NH_PCT:HISPANIC_PCT) %>%
mutate(wave = as.numeric(wave))
housing_pct_all_decades_cbg <- housing_all_decades_cbg %>%
mutate_at(vars(OCCUPIED_UNITS, VACANT_UNITS), funs("PCT" = (./H_UNITS) * 100)) %>%
mutate_at(vars(OWNER_OCC:RENTER_OCC), funs("PCT" = (./OCCUPIED_UNITS) * 100)) %>%
select(GEOID:H_UNITS, OCCUPIED_UNITS_PCT:RENTER_OCC_PCT) %>%
mutate(wave = as.numeric(wave))
income_pct_all_decades_cbg <- income_all_decades_cbg %>%
mutate_at(vars(starts_with("INC_")), funs("PCT" = (./HH) * 100)) %>%
mutate(LOW_INC_PCT = rowSums(across(INC_LT10K_PCT:INC_20KTO24999_PCT)),
MID_INC_PCT = rowSums(across(INC_25KTO29999_PCT:INC_75KTO99999_PCT)),
AFF_INC_PCT = rowSums(across(INC_100KTO124999_PCT:INC_150KPLUS_PCT))
) %>%
select(GEOID:wave, LOW_INC_PCT:AFF_INC_PCT) %>%
mutate(wave = as.numeric(wave))
full_cbg_data <- evi_all_decades_cbg %>%
mutate(wave = replace(wave, wave == 2020, 2019)) %>%
left_join(., cbg_all_geoids, by = "GISJOIN") %>%
left_join(., race_pct_all_decades_cbg, by = c("GEOID10" = "GEOID",
"wave" = "wave")) %>%
left_join(., housing_pct_all_decades_cbg, by = c("GEOID10" = "GEOID",
"wave" = "wave")) %>%
left_join(., income_pct_all_decades_cbg, by = c("GEOID10" = "GEOID",
"wave" = "wave")) %>%
relocate(evi, .before = TOT_POP) %>%
left_join(., cbg_area, by = "GEOID10") %>%
mutate(POP_DENS = TOT_POP/area,
H_DENS = H_UNITS/area) %>%
filter(evi >= 0)Greenness (EVI/NDVI) may take on different meanings/levels in metropolitan and micropolitan areas. Previous work has suggested that they shouldn’t be studied together. If we look at the distributions of EVI at the place level across metro and micropolitan areas, there do not appear to be striking differences.
place_evi_by_year <- full_cbg_data %>%
ungroup() %>%
group_by(PLACEFP_DERIVED, PLACE_DERIVED_NM, wave, in_metro) %>%
filter(!is.na(in_metro),
evi >=0) %>%
summarize(evi_mean = mean(evi, na.rm = T),
evi_min = min(evi, na.rm = T),
evi_max = max(evi, na.rm = T),
n = n())
metro_micro_place_evi_comparison <- place_evi_by_year %>%
ungroup() %>%
filter(!is.na(evi_mean)) %>%
group_by(in_metro, wave) %>%
summarize_at(vars(evi_mean), list(mean = mean, sd = sd, median = median, min = min, max = max))
violin_evi_by_metro_status <- place_evi_by_year %>%
ggplot(aes(fill = as.factor(wave), y = evi_mean, x = in_metro)) +
geom_violin(position = "dodge", alpha = 0.5, outlier.colour = "transparent") +
scale_fill_viridis(discrete = T, name = "") +
theme_minimal() +
theme(legend.position="right") +
labs(title = "Place-level EVI by Metro & Micro Area",
y = "Average EVI",
x = "")
violin_evi_by_metro_statusThe summary statistics indicate noticeable increases from 2010 to 2020 for metro and micro areas at both the center and tails of the distributions.
metro_micro_place_evi_comparison <- place_evi_by_year %>%
ungroup() %>%
filter(!is.na(evi_mean)) %>%
group_by(in_metro, wave) %>%
summarize_at(vars(evi_mean), list(mean = mean, sd = sd, median = median, min = min, max = max))
knitr::kable(metro_micro_place_evi_comparison,
digits = 3,
caption = "Summary of Place-Level EVI by Metro-Micro Area",
col.names = c("Region Type", "Year", "Mean", "SD", "Median", "Min", "Max")
)| Region Type | Year | Mean | SD | Median | Min | Max |
|---|---|---|---|---|---|---|
| Metropolitan Area | 1990 | 0.395 | 0.126 | 0.408 | 0.024 | 0.751 |
| Metropolitan Area | 2000 | 0.415 | 0.129 | 0.426 | 0.041 | 0.804 |
| Metropolitan Area | 2010 | 0.419 | 0.126 | 0.432 | 0.027 | 0.771 |
| Metropolitan Area | 2019 | 0.482 | 0.143 | 0.495 | 0.014 | 0.898 |
| Micropolitan Area | 1990 | 0.422 | 0.117 | 0.432 | 0.028 | 0.770 |
| Micropolitan Area | 2000 | 0.441 | 0.130 | 0.448 | 0.091 | 0.784 |
| Micropolitan Area | 2010 | 0.449 | 0.126 | 0.457 | 0.104 | 0.750 |
| Micropolitan Area | 2019 | 0.525 | 0.149 | 0.535 | 0.137 | 0.855 |
The figure below illustrates the relationship between the average neighborhood racial composition and the EVI level for each decade within metropolitan areas.
The average neighborhood with an EVI of 0.5 was 83% white in 1990, 74% white in 2000, and 65% in 2010. The average share of Hispanics in a neighborhood of that same greenness level was 3% in 1990 and then 12% in 2010.
If we look at a neighborhood with a low average EVI such as 0.1, the average share of whites in 1990 was 48% and then fell to 38% in 2010.
Lastly, at the high end of the greenness scale around 0.8, the average share of whites in a neighborhood was 96% in 1990 and 93% in 2010. The average percent of Hispanics in a highly green neighborhood was less than 1% in 1990 and 3% in 2010, while the share of Black residents hovered around 2% across this time period.
Overall, as the EVI increases, the average percent of whites also increased. However, as of 2010, minorities - particularly, Hispanics and Blacks, make up larger average shares of greener neighborhoods. This pattern appears across each of the years.
## CBG EVI & AVG RACIAL COMPOSITION METRO AREAS
average_cbg_composition_by_evi <- full_cbg_data %>%
ungroup() %>%
filter(evi >= 0 & evi <= 1,
!is.na(evi),
in_metro == "Metropolitan Area") %>%
mutate(wave = as.character(wave),
evi = round(evi, 2)) %>%
select(wave, evi, WHITE_NH_PCT:HISPANIC_PCT) %>%
group_by(wave, evi) %>%
summarise(across(where(is.numeric), ~ mean(.x, na.rm = TRUE))) %>%
pivot_longer(
cols = ends_with("_PCT"),
names_to = "race",
values_to = "percent",
) %>%
mutate(race = str_remove(race, "_PCT"))
ggplot(average_cbg_composition_by_evi, aes(x=evi, y=percent, fill=race)) +
geom_area(alpha=0.6 , size=.5, colour="white") +
facet_wrap(~ wave, nrow = 4) +
scale_fill_brewer(palette = "Set2") +
theme_minimal() +
labs(title = "Average Neighborhood Composition by Level of Greenness",
y = "Average Neighborhood Composition (%)",
x = "EVI",
fill = "Race")How do metro areas compare to micropolitan areas with respect to racial/ethnic composition and greenness? The multiple area graphs below show the breakdown by year and type of statistical region. Compared to the metropolitan areas, the neighborhoods in micropolitan areas did not experience the same increase in the average share of minority residents in neighborhoods with the highest levels of greenness.
## CBG EVI & AVG RACIAL COMPOSITION METRO V. MICRO AREAS
average_cbg_composition_by_evi_all_cbsa <- full_cbg_data %>%
ungroup() %>%
filter(evi >= 0 & evi <= 1,
!is.na(evi),
!is.na(in_metro)) %>%
mutate(wave = as.character(wave),
evi = round(evi, 2)) %>%
select(wave, in_metro, evi, WHITE_NH_PCT:HISPANIC_PCT) %>%
group_by(wave, evi, in_metro) %>%
summarise(across(where(is.numeric), ~ mean(.x, na.rm = TRUE))) %>%
pivot_longer(
cols = ends_with("_PCT"),
names_to = "race",
values_to = "percent",
) %>%
mutate(race = str_remove(race, "_PCT"))
ggplot(average_cbg_composition_by_evi_all_cbsa, aes(x=evi, y=percent, fill=race)) +
geom_area(alpha=0.6 , size=.5, colour="white") +
facet_wrap(vars(wave, in_metro), nrow = 4) +
scale_fill_brewer(palette = "Set2") +
theme_minimal() +
labs(title = "Average Neighborhood Composition by Level of Greenness",
y = "Average Neighborhood Composition (%)",
x = "EVI",
fill = "Race")1990 Anomaly - High EVI and high average % Black residents
In the 1990 area chart above, the racial breakdown for high EVI values (i.e., above 0.8) changes drastically. According to the chart, the average neighborhood with an EVI of 0.84 is 95% Black. A deeper investigation into this data point reveals that only one census block group fell between 0.84 and 0.85 EVI score in 1990, and this particular census block had a racial composition that was 95% Black.
This census block group is in Summerfield, Maryland, which is a suburb of Prince George’s County. It is located in the Washington DC metro area. The census block group experienced demographic changes and decreasing greenness after 1990. Notably, the share of Black residents declined, while white and Hispanic residents increased. Despite these changes, Black residents were still the majority racial group in the neighborhood. EVI dropped to around 0.4/0.5 levels, which mirrors its neighboring census block group in Summerfield.
## 1990 ANOMALY
knitr::kable(full_cbg_data %>%
filter(wave == 1990,
evi > 0.84,
evi < 0.85) %>%
ungroup() %>%
select(PLACE_NM, CBSA_NM, evi, WHITE_NH_PCT, BLACK_NH_PCT),
digits = 2,
caption = "1990 Anomaly",
col.names = c("Place", "Metro", "EVI", " % White", "% Black")
)| Place | Metro | EVI | % White | % Black |
|---|---|---|---|---|
| Summerfield CDP | Washington-Arlington-Alexandria, DC-VA-MD-WV Metro Area | 0.84 | 3.61 | 94.94 |
knitr::kable(full_cbg_data %>%
filter(PLACEFP_DERIVED == "2475810") %>%
arrange(wave, evi) %>%
mutate(wave = as.factor(wave)) %>%
ungroup() %>%
relocate(wave, .after = GEOID10) %>%
select(GEOID10, wave, evi, BLACK_NH_PCT, POP_DENS),
digits = 2,
format.args = list(big.mark = ','),
caption = "Summerfield, MD Census Block Group EVI and Demographics",
col.names = c("CBG", "Year", "EVI", "% Black", "People/Sq. Mi.")
)| CBG | Year | EVI | % Black | People/Sq. Mi. |
|---|---|---|---|---|
| 240338035192 | 1990 | 0.84 | 94.94 | 6,481.92 |
| 240338035192 | 2000 | 0.46 | 55.27 | 17,884.51 |
| 240338035192 | 2010 | 0.43 | 61.82 | 1,176.27 |
| 240338035192 | 2019 | 0.53 | 88.20 | 13,773.07 |
| 240338035242 | 1990 | 0.60 | 96.41 | 4,624.98 |
| 240338035242 | 2000 | 0.42 | 70.39 | 8,400.47 |
| 240338035242 | 2010 | 0.42 | 94.43 | 3,111.12 |
| 240338035242 | 2019 | 0.50 | 89.90 | 8,388.70 |
# place_evi_comp <- place_evi_by_year %>%
# mutate(evi_range = evi_max - evi_min)
#
# place_evi_comp %>%
# ungroup() %>%
# filter(PLACEFP_DERIVED %in% top100_places$PLACEFP) %>%
# arrange(evi_range) %>%
# slice(1:50)## BEESWARM PLOTS OF WITHIN PLACE DISTRIBUTIONS
top100_places_within_time_comp <- full_cbg_data %>%
ungroup() %>%
filter(PLACEFP_DERIVED %in% top100_places$PLACEFP) %>%
mutate(state_fips = str_sub(PLACEFP_DERIVED, end = 2)) %>%
left_join(., state_id_regions, by = "state_fips") %>%
mutate(PLACE_NM = str_remove(PLACE_DERIVED_NM, " city"),
PLACE_ST_NM = str_c(PLACE_NM, state_ab, sep = ", "),
year = as.character(wave),
year_abb = str_sub(year, start = 3),
year_abb = paste0("'", year_abb)
)
# NORTHEAST
top100_places_within_time_comp %>%
filter(region == "Northeast") %>%
ggplot(., aes(x = year, y = evi, color = year)) +
geom_quasirandom() +
theme_minimal() +
scale_color_manual(values = wes_palette("Cavalcanti1")) +
theme_minimal() +
labs(
title = "Distribution of Greenspace in Northeastern Cities",
x = "Year",
y = "EVI",
caption = "Note: Each point represents a block group in the city") +
theme(legend.position = "none") +
facet_wrap(~ PLACE_ST_NM) # MidAtlantic
top100_places_within_time_comp %>%
filter(region == "Mid-Atlantic") %>%
ggplot(., aes(x = year, y = evi, color = year)) +
geom_quasirandom() +
theme_minimal() +
scale_color_manual(values = wes_palette("Cavalcanti1")) +
theme_minimal() +
labs(
title = "Distribution of Greenspace in Mid-Atlantic Cities",
x = "Year",
y = "EVI",
caption = "Note: Each point represents a block group in the city") +
theme(legend.position = "none") +
facet_wrap(~ PLACE_ST_NM)# MIDWEST
top100_places_within_time_comp %>%
filter(region == "Midwest") %>%
mutate(PLACE_ST_NM = gsub("\\s*\\([^\\)]+\\)", "", PLACE_ST_NM)) %>%
ggplot(., aes(x = year, y = evi, color = year)) +
geom_quasirandom() +
theme_minimal() +
scale_color_manual(values = wes_palette("Cavalcanti1")) +
theme_minimal() +
labs(
title = "Distribution of Greenspace in Midwestern Cities",
x = "Year",
y = "EVI",
caption = "Note: Each point represents a block group in the city") +
theme(legend.position = "none") +
facet_wrap(~ PLACE_ST_NM)# SOUTH
top100_places_within_time_comp %>%
filter(region == "South") %>%
mutate(PLACE_ST_NM = str_remove(PLACE_ST_NM, " urban county"),
PLACE_ST_NM = str_remove(PLACE_ST_NM, " government"),
PLACE_ST_NM = str_remove(PLACE_ST_NM, " metropolitan"),
PLACE_ST_NM = str_remove(PLACE_ST_NM, " metro"),
PLACE_ST_NM = gsub("\\s*\\([^\\)]+\\)", "", PLACE_ST_NM)
) %>%
ggplot(., aes(x = year, y = evi, color = year)) +
geom_quasirandom() +
theme_minimal() +
scale_color_manual(values = wes_palette("Cavalcanti1")) +
theme_minimal() +
labs(
title = "Distribution of Greenspace in Southern Cities",
x = "Year",
y = "EVI",
caption = "Note: Each point represents a block group in the city") +
theme(legend.position = "none") +
facet_wrap(~ PLACE_ST_NM)# SOUTHWEST
top100_places_within_time_comp %>%
filter(region == "Southwest") %>%
ggplot(., aes(x = year, y = evi, color = year)) +
geom_quasirandom() +
theme_minimal() +
scale_color_manual(values = wes_palette("Cavalcanti1")) +
theme_minimal() +
labs(
title = "Distribution of Greenspace in Southwestern Cities",
x = "Year",
y = "EVI",
caption = "Note: Each point represents a block group in the city") +
theme(legend.position = "none") +
facet_wrap(~ PLACE_ST_NM)# MOUNTAINWEST
top100_places_within_time_comp %>%
filter(region == "West") %>%
ggplot(., aes(x = year, y = evi, color = year)) +
geom_quasirandom() +
theme_minimal() +
scale_color_manual(values = wes_palette("Cavalcanti1")) +
theme_minimal() +
labs(
title = "Distribution of Greenspace in Mountain-West Cities",
x = "Year",
y = "EVI",
caption = "Note: Each point represents a block group in the city") +
theme(legend.position = "none") +
facet_wrap(~ PLACE_ST_NM)# PACIFIC WEST
top100_places_within_time_comp %>%
filter(region == "Pacific") %>%
mutate(PLACE_ST_NM = str_remove(PLACE_ST_NM, " municipality"),
PLACE_ST_NM = str_remove(PLACE_ST_NM, " Urban")) %>%
ggplot(., aes(x = year, y = evi, color = year)) +
geom_quasirandom() +
theme_minimal() +
scale_color_manual(values = wes_palette("Cavalcanti1")) +
theme_minimal() +
labs(
title = "Distribution of Greenspace in Pacific-West Cities",
x = "Year",
y = "EVI",
caption = "Note: Each point represents a block group in the city") +
theme(legend.position = "none") +
facet_wrap(~ PLACE_ST_NM)## PREP GREENSPACE DATA
evi_area_full_cbg <- evi_area_decades_cbg %>%
rename(green_area = "area") %>%
left_join(., cbg_all_geoids, by = "GISJOIN") %>%
select(GISJOIN:CBSA_NM, top100_place, in_metro) %>%
left_join(., cbg_area, by = "GEOID10") %>%
mutate(perc_green = green_area/area,
perc_green = if_else(perc_green > 1,
1,
perc_green)
) %>%
left_join(., full_cbg_data, by = c("GISJOIN", "wave"))
top100_places_area_within_time_comp <- evi_area_full_cbg %>%
filter(PLACEFP_DERIVED.x %in% top100_places$PLACEFP) %>%
mutate(state_fips = str_sub(PLACEFP_DERIVED.x, end = 2)) %>%
left_join(., state_id_regions, by = "state_fips") %>%
mutate(PLACE_NM = str_remove(PLACE_DERIVED_NM.x, " city"),
PLACE_ST_NM = str_c(PLACE_NM.x, state_ab, sep = ", "),
year = as.character(wave),
majority_minority = if_else(WHITE_NH_PCT <50,
"Majority Nonwhite",
"Majority white")
)# NORTHEAST
top100_places_area_within_time_comp %>%
filter(region == "Northeast",
!is.na(majority_minority)) %>%
ggplot(., aes(x=year, y=perc_green, fill=majority_minority)) +
geom_boxplot() +
scale_fill_manual(values = wes_palette("Chevalier1")) +
guides(fill=guide_legend(title="Racial Composition")) +
theme_minimal() +
labs(
title = "Distribution of Greenspace Area in Northeastern Cities",
x = "Year",
y = "% Green Landcover") +
facet_wrap(~PLACE_ST_NM)# MIDATLANTIC
top100_places_area_within_time_comp %>%
filter(region == "Mid-Atlantic",
!is.na(majority_minority)) %>%
ggplot(., aes(x=year, y=perc_green, fill=majority_minority)) +
geom_boxplot() +
scale_fill_manual(values = wes_palette("Chevalier1")) +
guides(fill=guide_legend(title="Racial Composition")) +
theme_minimal() +
theme(legend.position = "none") +
labs(
title = "Distribution of Greenspace Area in Mid-Atlantic Cities",
x = "Year",
y = "% Green Landcover") +
facet_wrap(~PLACE_ST_NM)# MIDWEST
top100_places_area_within_time_comp %>%
filter(region == "Midwest",
!is.na(majority_minority)) %>%
mutate(PLACE_ST_NM = gsub("\\s*\\([^\\)]+\\)", "", PLACE_ST_NM)) %>%
ggplot(., aes(x=year, y=perc_green, fill=majority_minority)) +
geom_boxplot() +
scale_fill_manual(values = wes_palette("Chevalier1")) +
guides(fill=guide_legend(title="Racial Composition")) +
theme_minimal() +
theme(legend.position = "none") +
labs(
title = "Distribution of Greenspace Area in Midwestern Cities",
x = "Year",
y = "% Green Landcover") +
facet_wrap(~PLACE_ST_NM)# SOUTH
top100_places_area_within_time_comp %>%
filter(region == "South",
!is.na(majority_minority)) %>%
mutate(PLACE_ST_NM = str_remove(PLACE_ST_NM, " urban county"),
PLACE_ST_NM = str_remove(PLACE_ST_NM, " government"),
PLACE_ST_NM = str_remove(PLACE_ST_NM, " metropolitan"),
PLACE_ST_NM = str_remove(PLACE_ST_NM, " metro"),
PLACE_ST_NM = str_remove(PLACE_ST_NM, " County"),
PLACE_ST_NM = gsub("\\s*\\([^\\)]+\\)", "", PLACE_ST_NM)
) %>%
ggplot(., aes(x=year, y=perc_green, fill=majority_minority)) +
geom_boxplot() +
scale_fill_manual(values = wes_palette("Chevalier1")) +
guides(fill=guide_legend(title="Racial Composition")) +
theme_minimal() +
theme(legend.position = "none") +
labs(
title = "Distribution of Greenspace Area in Southern Cities",
x = "Year",
y = "% Green Landcover") +
facet_wrap(~PLACE_ST_NM)# SOUTHWESTERN
top100_places_area_within_time_comp %>%
filter(region == "Southwest",
!is.na(majority_minority)) %>%
ggplot(., aes(x=year, y=perc_green, fill=majority_minority)) +
geom_boxplot() +
scale_fill_manual(values = wes_palette("Chevalier1")) +
guides(fill=guide_legend(title="Racial Composition")) +
theme_minimal() +
theme(legend.position = "none") +
labs(
title = "Distribution of Greenspace Area in Southwestern Cities",
x = "Year",
y = "% Green Landcover") +
facet_wrap(~PLACE_ST_NM)# MOUNTAIN WEST
top100_places_area_within_time_comp %>%
filter(region == "West",
!is.na(majority_minority)) %>%
ggplot(., aes(x=year, y=perc_green, fill=majority_minority)) +
geom_boxplot() +
scale_fill_manual(values = wes_palette("Chevalier1")) +
guides(fill=guide_legend(title="Racial Composition")) +
theme_minimal() +
theme(legend.position = "none") +
labs(
title = "Distribution of Greenspace Area in Mountain-west Cities",
x = "Year",
y = "% Green Landcover") +
facet_wrap(~PLACE_ST_NM)# PACIFIC WEST
top100_places_area_within_time_comp %>%
filter(region == "Pacific",
!is.na(majority_minority)) %>%
mutate(PLACE_ST_NM = str_remove(PLACE_ST_NM, " municipality"),
PLACE_ST_NM = str_remove(PLACE_ST_NM, "Urban ")) %>%
ggplot(., aes(x=year, y=perc_green, fill=majority_minority)) +
geom_boxplot() +
scale_fill_manual(values = wes_palette("Chevalier1")) +
guides(fill=guide_legend(title="Racial Composition")) +
theme_minimal() +
theme(legend.position = "none") +
labs(
title = "Distribution of Greenspace Area in Pacific-west Cities",
x = "Year",
y = "% Green Landcover") +
facet_wrap(~PLACE_ST_NM)# ss_demog_pal <- colorNumeric(
# palette = "Greens",
# domain = nc_evi$evi
# )
#
# leaflet() %>%
# addProviderTiles(providers$CartoDB.Positron) %>%
# addPolylines(
# data = ss_lines_with_service_area_demogs %>% st_transform(., crs = wgs),
# color = ~ss_demog_pal(tpop),
# #color = "white",
# opacity = 1,
# weight = 5,
# label = ~paste0(name, " - ",
# format(tpop, digits = 1, big.mark = ","),
# " residents"
# ),
# highlightOptions = highlightOptions(
# weight = 2,
# opacity = 1)
# ) %>%
# addLegend(
# position = "bottomleft",
# data = ss_lines_with_service_area_demogs,
# pal = ss_demog_pal,
# values = ~tpop,
# title = "Residents Served by Slow Streets"
# )
#
#
# ggplot() +
# geom_sf(aes(fill = evi)) #+
# geom_polygon(data = )