library(ggplot2)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(leaflet)
data <- read.csv("FATAL ENCOUNTERS DOT ORG SPREADSHEET.csv")
data_clean <- data %>%
filter(!is.na(Gender), !is.na(Race), !is.na(Location.of.injury..address.),
!is.na(Dispositions.Exclusions), !is.na(Longitude), !is.na(Latitude)) %>%
mutate(Longitude = as.numeric(Longitude), Latitude = as.numeric(Latitude))
## Warning: There was 1 warning in `mutate()`.
## ℹ In argument: `Latitude = as.numeric(Latitude)`.
## Caused by warning:
## ! NAs introduced by coercion
ggplot(data_clean, aes(x = Gender)) +
geom_bar(fill = "skyblue") +
theme_minimal() +
labs(title = "Gender Distribution of Police Killings", x = "Gender", y = "Count")
ggplot(data_clean, aes(x = Race)) +
geom_bar(fill = "coral") +
theme_minimal() +
labs(title = "Racial Distribution of Police Killings", x = "Race", y = "Count") +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
leaflet(data_clean) %>%
addTiles() %>%
addCircleMarkers(~Longitude, ~Latitude, radius = 2, color = "red",
popup = ~paste(Name, "<br>", Race, "<br>", Gender)) %>%
setView(lng = -98.35, lat = 39.5, zoom = 4) %>%
addLegend(position = "bottomright", colors = "red", labels = "Fatal Encounters", title = "Locations")
## Warning in validateCoords(lng, lat, funcName): Data contains 1 rows with either
## missing or invalid lat/lon values and will be ignored
disposition_counts <- data_clean %>%
group_by(Dispositions.Exclusions) %>%
summarise(count = n()) %>%
arrange(desc(count))
top_dispositions <- disposition_counts %>%
mutate(category = ifelse(row_number() <= 4,
Dispositions.Exclusions,
"Others"))
top_dispositions <- top_dispositions %>%
group_by(category) %>%
summarise(count = sum(count)) %>%
mutate(percentage = round(100 * count / sum(count), 1))
ggplot(top_dispositions, aes(x = "", y = count, fill = category)) +
geom_bar(stat = "identity", width = 1) +
coord_polar("y", start = 0) +
geom_text(aes(label = paste0(percentage, "%")),
position = position_stack(vjust = 0.5)) +
labs(title = "Case Dispositions of Police Killings") +
theme_void() +
theme(legend.title = element_blank())
The first chart shows the gender distribution of people killed by the police. The data shows that the vast majority of people killed by the police are men. In fact, according to the data, over 20,000 men have been killed by the police since 2013. This is a staggering number, and it is clear that men are disproportionately affected by police violence.
The racial distribution of police killings indicates significant disparities. African-American/Black individuals and Hispanic/Latino populations experience a disproportionately high number of incidents, along with a considerable number of cases where race is unspecified. European-American/White individuals also show a large count. This trend suggests a racial imbalance in police encounters leading to fatalities, particularly African-American and Hispanic populations.
This map shows the geographical distribution of police killings across the U.S., with significant concentrations in major urban areas and densely populated regions. The clustering in states like California, Texas, and along the East Coast highlights the prevalence of incidents in these regions. Rural areas also display a notable spread.
The case dispositions reveal a concerning number of police killings deemed ‘Unreported’ or ‘Pending investigation’, with a smaller percentage attributed to ‘Suicide’ and ‘Justified’ cases. This could imply a lack of transparency or thorough investigation into these incidents.