We can see from the below maps and tables that there was evidence of gerrymandering in 2024 presidential election.
One example is District 5. A district that mainly held Nashville and Davidson County was one of the communities with the most diversity. It held about 60% of white voters. After the redistricting, district 5 was split into districts 5,6, and 7. All of these districts all range from 70-80 percent white voters. This and other patterns show that the redistricting led to the diverse voters being “packed” into larger districts. This makes their vote mean a lot less in that district than it would have prior to the redistricting.
Given what we also know about Davidson county primarily voting for the democratic party, this also leads me to believe the redistricting was done to spread these democratic votes out.
# Installing and loading required packages
if (!require("tidyverse")) install.packages("tidyverse")
if (!require("tidycensus")) install.packages("tidycensus")
if (!require("sf")) install.packages("sf")
if (!require("mapview")) install.packages("mapview")
if (!require("leaflet")) install.packages("leaflet")
if (!require("leaflet.extras2")) install.packages("leaflet.extras2")
library(tidyverse)
library(tidycensus)
library(sf)
library(mapview)
library(leaflet)
library(leafpop)
# Transmitting API key
census_api_key("494018a70f114d4f76b10537730ccc9c7dbfe36b")
VariableList =
c(Estimate_ = "DP05_0037P")
# Fetching the data
mydata <- get_acs(
geography = "congressional district",
state = c("TN"),
variables = VariableList,
year = 2021,
survey = "acs1",
output = "wide",
geometry = TRUE)
mydata <- rename(mydata, Area = NAME,
Estimate = Estimate_E,
Range = Estimate_M)
# Mapping the data
Map1 <- mapview(
mydata,
zcol = "Estimate",
layer.name = "Estimate",
popup = popupTable(
mydata,
feature.id = FALSE,
row.numbers = FALSE,
zcol = c("Area", "Estimate", "Range")
)
)
Map1
# Plotting the data
mygraph1 <- ggplot(mydata, aes(x = Estimate, y = reorder(Area, Estimate))) +
geom_errorbarh(aes(xmin = Estimate - Range, xmax = Estimate + Range)) +
geom_point(size = 3, color = "#099d91") +
theme_minimal(base_size = 12.5) +
labs(title = "Estimates by area",
subtitle = "Brackets show error margins.",
x = "Pct. white 2021",
y = "")
mygraph1
# map 2 ---------------------------------------
mydata <- get_acs(
geography = "congressional district",
state = c("TN"),
variables = VariableList,
year = 2022,
survey = "acs1",
output = "wide",
geometry = TRUE)
mydata <- rename(mydata, Area = NAME,
Estimate = Estimate_E,
Range = Estimate_M)
# Mapping the data
Map2 <- mapview(
mydata,
zcol = "Estimate",
layer.name = "Estimate",
popup = popupTable(
mydata,
feature.id = FALSE,
row.numbers = FALSE,
zcol = c("Area", "Estimate", "Range")
)
)
Map2
# Plotting the data
mygraph2 <- ggplot(mydata, aes(x = Estimate, y = reorder(Area, Estimate))) +
geom_errorbarh(aes(xmin = Estimate - Range, xmax = Estimate + Range)) +
geom_point(size = 3, color = "#099d91") +
theme_minimal(base_size = 12.5) +
labs(title = "Estimates by area",
subtitle = "Brackets show error margins.",
x = "Pct. white 2022",
y = "")
mygraph2
Davidson2024 <- read.csv("https://github.com/drkblake/Data/raw/refs/heads/main/Davidson2024.csv")
# Load necessary libraries
library(ggplot2)
# Create the plot
ggplot(Davidson2024, aes(x = Pct_Nonwhite,
y = Pct_Harris,
color = Winner)) +
geom_point() +
geom_smooth(method = "lm",
se=FALSE) +
labs(
title = "Support for Harris, by percent minority, 2024" ,
x = "Pct. minority",
y = "Pct. Harris",
) +
scale_color_brewer(palette = "Dark2")