This analysis examines shooting incidents in New York City based on historic data from the NYPD. We will explore trends in incidents over the years and by region, along with a demographic breakdown of victims and shooters.
The data used in this analysis is retrieved from the NYC Open Data portal: - Dataset URL: NYPD Shooting Incident Data
url <- "https://data.cityofnewyork.us/api/views/833y-fsy8/rows.csv?accessType=DOWNLOAD"
library(readr)
library(tidyverse)
library(dplyr)
library(lubridate)
library(ggplot2)
## # A tibble: 6 × 10
## Incident_date Region Location Murder Shooter_age_group Shooter_sex
## <date> <chr> <chr> <lgl> <chr> <chr>
## 1 2021-08-09 BRONX <NA> FALSE <NA> <NA>
## 2 2018-04-07 BROOKLYN <NA> TRUE 25-44 M
## 3 2022-12-02 BRONX STREET FALSE (null) (null)
## 4 2006-11-19 BROOKLYN <NA> TRUE UNKNOWN U
## 5 2010-05-09 BRONX <NA> TRUE 25-44 M
## 6 2012-07-22 BRONX <NA> FALSE 18-24 M
## # ℹ 4 more variables: Shooter_race <chr>, Victim_age_group <chr>,
## # Victim_sex <chr>, Victim_race <chr>
## # A tibble: 6 × 3
## # Groups: Year [2]
## Year Region Count
## <dbl> <chr> <int>
## 1 2006 BRONX 568
## 2 2006 BROOKLYN 850
## 3 2006 MANHATTAN 288
## 4 2006 QUEENS 296
## 5 2006 STATEN ISLAND 53
## 6 2007 BRONX 533