Mapping West Indian heritage in Brooklyn, NY
library(tidyverse)
library(tidycensus)
## Warning: package 'tidycensus' was built under R version 4.4.1
library(sf)
## Warning: package 'sf' was built under R version 4.4.1
library(scales)
library(viridis)
library(plotly)
Purpose: Understand concentrations of population with West Indian heritage in Brooklyn, NY
Data sources:
5-year American Community Survey, 2018-2022: total population reporting heritage in Kings County, NY; population reporting West Indian Heritage in Kings County, NY
NYC Open Data: Borough boundary shapefile
Methods:
boros <- st_read("~/Documents/Grad School/Methods 1/part2/data/raw/geo/Borough Boundaries.geojson")
raw_ancestry <- get_acs(geography = "tract",
variables = c(ancestry_pop = "B04006_001",
west_indian = "B04006_094"),
state='NY',
county = 'Kings',
geometry = T,
year = 2020,
output = "wide")
## Warning: • You have not set a Census API key. Users without a key are limited to 500
## queries per day and may experience performance limitations.
## ℹ For best results, get a Census API key at
## http://api.census.gov/data/key_signup.html and then supply the key to the
## `census_api_key()` function to use it throughout your tidycensus session.
## This warning is displayed once per session.
west_indian <- raw_ancestry |>
mutate(pct_west_indian = west_indianE/ancestry_popE,
pct_west_indian = ifelse(is.nan(pct_west_indian), NA, pct_west_indian))
ggplot() +
geom_sf(data = west_indian,
mapping = aes(fill = pct_west_indian,
test = paste0(NAME, ":",
"<br>Percent West Indian Ancestry: ",
percent(pct_west_indian, accuracy=1))),
color = "transparent") +
theme_void() +
scale_fill_distiller(breaks=c(0, .2, .4, .6, .8, 1),
direction = 1,
na.value = "transparent",
name="Percent West Indian Ancestry (%)",
labels=percent_format(accuracy = 1L)) +
labs(
title = "Brooklyn, West Indian Ancestry by Census Tract",
caption = "Source: American Community Survey, 2018-22"
) +
geom_sf(data = boros |> filter(boro_name == "Brooklyn"),
color = "black", fill = NA, lwd = .5)
## Warning in layer_sf(geom = GeomSf, data = data, mapping = mapping, stat = stat,
## : Ignoring unknown aesthetics: test
As demonstrated in the map above, West Indian populations are highly
concentrated in the Canarsie, East Flatbush, and Flatlands neighborhoods
of Brooklyn, with lower density in East New York and Crown Heights as
well. There are very low concentrations of population with West Indian
heritage in other Brooklyn neighborhoods.