## # A tibble: 36,607 × 3
##    name        label                                    concept                 
##    <chr>       <chr>                                    <chr>                   
##  1 B01001A_001 Estimate!!Total:                         Sex by Age (White Alone)
##  2 B01001A_002 Estimate!!Total:!!Male:                  Sex by Age (White Alone)
##  3 B01001A_003 Estimate!!Total:!!Male:!!Under 5 years   Sex by Age (White Alone)
##  4 B01001A_004 Estimate!!Total:!!Male:!!5 to 9 years    Sex by Age (White Alone)
##  5 B01001A_005 Estimate!!Total:!!Male:!!10 to 14 years  Sex by Age (White Alone)
##  6 B01001A_006 Estimate!!Total:!!Male:!!15 to 17 years  Sex by Age (White Alone)
##  7 B01001A_007 Estimate!!Total:!!Male:!!18 and 19 years Sex by Age (White Alone)
##  8 B01001A_008 Estimate!!Total:!!Male:!!20 to 24 years  Sex by Age (White Alone)
##  9 B01001A_009 Estimate!!Total:!!Male:!!25 to 29 years  Sex by Age (White Alone)
## 10 B01001A_010 Estimate!!Total:!!Male:!!30 to 34 years  Sex by Age (White Alone)
## # ℹ 36,597 more rows
## [1] "e9062f013a68317e4a158ee94eeb55a8f957224f"

Introduction

This analysis examines racial composition changes across Tennessee’s U.S. House districts before and after the 2022 redistricting. Specifically, it explores whether racial gerrymandering may have occurred, with a focus on Davidson County.

Map: Percent White by Congressional District (2021)

##   |                                                                              |                                                                      |   0%  |                                                                              |                                                                      |   1%  |                                                                              |=                                                                     |   1%  |                                                                              |=                                                                     |   2%  |                                                                              |==                                                                    |   3%  |                                                                              |===                                                                   |   4%  |                                                                              |===                                                                   |   5%  |                                                                              |====                                                                  |   5%  |                                                                              |====                                                                  |   6%  |                                                                              |=====                                                                 |   7%  |                                                                              |======                                                                |   8%  |                                                                              |======                                                                |   9%  |                                                                              |=======                                                               |  10%  |                                                                              |========                                                              |  11%  |                                                                              |=========                                                             |  12%  |                                                                              |=========                                                             |  13%  |                                                                              |==========                                                            |  14%  |                                                                              |===========                                                           |  16%  |                                                                              |============                                                          |  17%  |                                                                              |============                                                          |  18%  |                                                                              |==============                                                        |  20%  |                                                                              |================                                                      |  23%  |                                                                              |=================                                                     |  24%  |                                                                              |=================                                                     |  25%  |                                                                              |==================                                                    |  26%  |                                                                              |====================                                                  |  28%  |                                                                              |=====================                                                 |  31%  |                                                                              |=======================                                               |  33%  |                                                                              |=========================                                             |  36%  |                                                                              |===========================                                           |  38%  |                                                                              |============================                                          |  41%  |                                                                              |==============================                                        |  43%  |                                                                              |================================                                      |  45%  |                                                                              |=================================                                     |  48%  |                                                                              |===================================                                   |  49%  |                                                                              |====================================                                  |  51%  |                                                                              |====================================                                  |  52%  |                                                                              |=====================================                                 |  52%  |                                                                              |======================================                                |  54%  |                                                                              |======================================                                |  55%  |                                                                              |========================================                              |  57%  |                                                                              |=========================================                             |  58%  |                                                                              |=========================================                             |  59%  |                                                                              |==========================================                            |  59%  |                                                                              |==========================================                            |  60%  |                                                                              |==========================================                            |  61%  |                                                                              |===========================================                           |  61%  |                                                                              |============================================                          |  62%  |                                                                              |============================================                          |  63%  |                                                                              |=============================================                         |  65%  |                                                                              |==============================================                        |  65%  |                                                                              |==============================================                        |  66%  |                                                                              |===============================================                       |  67%  |                                                                              |================================================                      |  68%  |                                                                              |================================================                      |  69%  |                                                                              |=================================================                     |  70%  |                                                                              |==================================================                    |  71%  |                                                                              |==================================================                    |  72%  |                                                                              |====================================================                  |  74%  |                                                                              |====================================================                  |  75%  |                                                                              |=====================================================                 |  75%  |                                                                              |=====================================================                 |  76%  |                                                                              |======================================================                |  77%  |                                                                              |=======================================================               |  79%  |                                                                              |=========================================================             |  81%  |                                                                              |=========================================================             |  82%  |                                                                              |===========================================================           |  84%  |                                                                              |=============================================================         |  87%  |                                                                              |==============================================================        |  89%  |                                                                              |===============================================================       |  90%  |                                                                              |================================================================      |  91%  |                                                                              |=================================================================     |  93%  |                                                                              |==================================================================    |  94%  |                                                                              |====================================================================  |  97%  |                                                                              |===================================================================== |  99%  |                                                                              |======================================================================| 100%

Map: Percent White by Congressional District (2022)

##   |                                                                              |                                                                      |   0%  |                                                                              |=                                                                     |   1%  |                                                                              |=                                                                     |   2%  |                                                                              |==                                                                    |   2%  |                                                                              |===                                                                   |   5%  |                                                                              |=====                                                                 |   8%  |                                                                              |=======                                                               |  10%  |                                                                              |=========                                                             |  13%  |                                                                              |===========                                                           |  15%  |                                                                              |============                                                          |  18%  |                                                                              |==============                                                        |  20%  |                                                                              |================                                                      |  23%  |                                                                              |==================                                                    |  26%  |                                                                              |===================                                                   |  27%  |                                                                              |====================                                                  |  28%  |                                                                              |=====================                                                 |  30%  |                                                                              |======================                                                |  31%  |                                                                              |======================                                                |  32%  |                                                                              |=======================                                               |  33%  |                                                                              |========================                                              |  34%  |                                                                              |=========================                                             |  36%  |                                                                              |===========================                                           |  39%  |                                                                              |============================                                          |  40%  |                                                                              |==============================                                        |  42%  |                                                                              |===============================                                       |  44%  |                                                                              |=================================                                     |  47%  |                                                                              |===================================                                   |  50%  |                                                                              |=====================================                                 |  52%  |                                                                              |=======================================                               |  55%  |                                                                              |========================================                              |  58%  |                                                                              |=========================================                             |  58%  |                                                                              |==========================================                            |  61%  |                                                                              |============================================                          |  63%  |                                                                              |=============================================                         |  64%  |                                                                              |==============================================                        |  65%  |                                                                              |===============================================                       |  67%  |                                                                              |===============================================                       |  68%  |                                                                              |=================================================                     |  70%  |                                                                              |==================================================                    |  71%  |                                                                              |==================================================                    |  72%  |                                                                              |===================================================                   |  72%  |                                                                              |===================================================                   |  73%  |                                                                              |====================================================                  |  74%  |                                                                              |=====================================================                 |  75%  |                                                                              |======================================================                |  77%  |                                                                              |=======================================================               |  79%  |                                                                              |========================================================              |  80%  |                                                                              |========================================================              |  81%  |                                                                              |=========================================================             |  81%  |                                                                              |==========================================================            |  83%  |                                                                              |===========================================================           |  84%  |                                                                              |============================================================          |  85%  |                                                                              |============================================================          |  86%  |                                                                              |=============================================================         |  87%  |                                                                              |==============================================================        |  88%  |                                                                              |==============================================================        |  89%  |                                                                              |===============================================================       |  90%  |                                                                              |================================================================      |  92%  |                                                                              |=================================================================     |  92%  |                                                                              |==================================================================    |  94%  |                                                                              |===================================================================   |  96%  |                                                                              |===================================================================== |  99%  |                                                                              |======================================================================| 100%

Chart: Percent White by District (2021)

Horizontal Chart: Percent White by District (2022)

Davidson County: Race and Vote Share

Conclusion

The shift in racial composition after the 2022 redistricting, particularly in Davidson County, supports claims that minority voters may have been intentionally fragmented to reduce their political influence. The data visualization and voting trends show patterns consistent with racial gerrymandering.

# Required packages
library(tidyverse)
library(tidycensus)
library(sf)
library(mapview)
library(leaflet)
library(leaflet.extras2)
library(leafpop)
library(RColorBrewer)

# Load ACS variable names
tidycensus::load_variables(2022, "acs1", cache = TRUE)

# Set Census API Key
census_api_key("e9062f013a68317e4a158ee94eeb55a8f957224f", install = TRUE, overwrite = TRUE)

# Define variable for % White
VariableList <- c(pctwhite = "DP05_0077P")

Data2021 <- get_acs(
  geography = "congressional district",
  state = "TN",
  variables = VariableList,
  year = 2021,
  survey = "acs1",
  output = "wide",
  geometry = TRUE
)
Data2021 <- rename(Data2021, Area = NAME, PctWhite = pctwhiteE, Range = pctwhiteM)

Map2021 <- mapview(
  Data2021, zcol = "PctWhite", layer.name = "Percent White (2021)",
  col.regions = brewer.pal(9, "Purples"),
  popup = popupTable(Data2021, feature.id = FALSE, row.numbers = FALSE,
                     zcol = c("Area", "PctWhite", "Range"))
)
Map2021

Data2022 <- get_acs(
  geography = "congressional district",
  state = "TN",
  variables = VariableList,
  year = 2022,
  survey = "acs1",
  output = "wide",
  geometry = TRUE
)
Data2022 <- rename(Data2022, Area = NAME, PctWhite = pctwhiteE, Range = pctwhiteM)

Map2022 <- mapview(
  Data2022, zcol = "PctWhite", layer.name = "Percent White (2022)",
  col.regions = brewer.pal(9, "Greens"),
  popup = popupTable(Data2022, feature.id = FALSE, row.numbers = FALSE,
                     zcol = c("Area", "PctWhite", "Range"))
)
Map2022  # Updated to ensure identical variables as 2021

mygraph2021 <- ggplot(Data2021, aes(x = PctWhite, y = reorder(Area, PctWhite))) +
  geom_errorbarh(aes(xmin = PctWhite - Range, xmax = PctWhite + Range)) +
  geom_point(size = 3, color = "#228B22") +
  theme_minimal(base_size = 13) +
  labs(title = "Percent White by Congressional District (2021)",
       subtitle = "Margins represent sampling error", x = "% White", y = "")
print(mygraph2021)

mygraph2022b <- ggplot(Data2022, aes(x = PctWhite, y = reorder(Area, PctWhite))) + 
  geom_errorbarh(aes(xmin = PctWhite - Range, xmax = PctWhite + Range)) + 
  geom_point(size = 3, color = "#099d91") + 
  theme_minimal(base_size = 12.5) +
  labs(title = "Percent White by Congressional District (2022)", 
       subtitle = "Tennessee - ACS 2022 Data", 
       x = "Percentage", 
       y = "District")
mygraph2022b

Davidson2024 <- read.csv("https://github.com/drkblake/Data/raw/refs/heads/main/Davidson2024.csv")
precinctPlot <- ggplot(Davidson2024, aes(x = Pct_Nonwhite, y = Pct_Harris, color = Winner)) +
  geom_point(size = 3, alpha = 0.8) +
  scale_color_manual(values = c("Harris" = "#2E8B57", "Trump" = "#DC143C")) +
  theme_minimal(base_size = 13) +
  labs(title = "Nonwhite Population vs. Harris Vote Share by Precinct",
       subtitle = "Davidson County, 2024",
       x = "% Nonwhite Residents", y = "% Voted for Harris")
print(precinctPlot)