Rows: 4408 Columns: 18
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (10): :id, :version, patrol_borough_name, county, law_code_category_des...
dbl (4): full_complaint_id, complaint_year_number, month_number, complaint...
lgl (1): arrest_date
dttm (3): :created_at, :updated_at, record_create_date
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
bias_count |>head(10) |>ggplot(aes(x=bias_motive_description, y = n)) +geom_col()
Arrange the bars according to height and rotate
bias_count |>head(10) |>ggplot(aes(x=reorder(bias_motive_description, n), y = n)) +geom_col() +coord_flip()
Add title, caption for data source, and x-axis label
bias_count |>head(10) |>ggplot(aes(x=reorder(bias_motive_description, n), y = n)) +geom_col() +coord_flip()+labs(x ="",y ="Counts of hatecrime types based on motive",title ="Bar Graph of Hate Crimes from 2019-2026",subtitle ="Counts based on the hatecrime motive",caption ="Source: NY State Division of Criminal Justice Services")
Add color and change theme
bias_count |>head(10) |>ggplot(aes(x=reorder(bias_motive_description, n), y = n)) +geom_col(fill ="salmon") +coord_flip()+labs(x ="",y ="Counts of hatecrime types based on motive",title ="Bar Graph of Hate Crimes from 2019-2026",subtitle ="Counts based on the hatecrime motive",caption ="Source: NY State Division of Criminal Justice Services") +theme_minimal()
Add annotations for counts and remove x-axis values
bias_count |>head(10) |>ggplot(aes(x=reorder(bias_motive_description, n), y = n)) +geom_col(fill ="salmon") +coord_flip()+labs(x ="",y ="Counts of hatecrime types based on motive",title ="Bar Graph of Hate Crimes from 2019-2026",subtitle ="Counts based on the hatecrime motive",caption ="Source: NY State Division of Criminal Justice Services") +theme_minimal()+geom_text(aes(label = n), hjust =-.05, size =3) +theme(axis.text.x =element_blank())
# A tibble: 143 × 4
# Groups: complaint_year_number, county [40]
complaint_year_number county bias_motive_description n
<dbl> <chr> <chr> <int>
1 2024 KINGS ANTI-JEWISH 151
2 2025 KINGS ANTI-JEWISH 142
3 2024 NEW YORK ANTI-JEWISH 137
4 2019 KINGS ANTI-JEWISH 128
5 2023 KINGS ANTI-JEWISH 126
6 2022 KINGS ANTI-JEWISH 125
7 2025 NEW YORK ANTI-JEWISH 124
8 2023 NEW YORK ANTI-JEWISH 123
9 2022 NEW YORK ANTI-JEWISH 104
10 2021 NEW YORK ANTI-ASIAN 84
# ℹ 133 more rows
Plot hate crimes together
ggplot(data = hate2) +geom_bar(aes(x=complaint_year_number, y=n, fill = bias_motive_description),position ="dodge", stat ="identity") +labs(fill ="Hate Crime Type",y ="Number of Hate Crime Incidents",title ="Hate Crime Type in NY Counties Between 2010-2016",caption ="Source: NY State Division of Criminal Justice Services")
Make bar graphs by counties
ggplot(data = hate2) +geom_bar(aes(x=county, y=n, fill = bias_motive_description),position ="dodge", stat ="identity") +labs(fill ="Hate Crime Type",y ="Number of Hate Crime Incidents",title ="Hate Crime Type in NY Counties Between 2010-2016",caption ="Source: NY State Division of Criminal Justice Services")
Put it all together using “facet”
ggplot(data = hate2) +geom_bar(aes(x=complaint_year_number, y=n, fill = bias_motive_description),position ="dodge", stat ="identity") +facet_wrap(~county) +labs(fill ="Hate Crime Type",y ="Number of Hate Crime Incidents",title ="Hate Crime Type in NY Counties Between 2010-2016",caption ="Source: NY State Division of Criminal Justice Services")
county X_2020_census_population
1 Albany County 314848
2 Allegany County 46456
3 Bronx County 1472654
4 Broome County 198683
5 Cattaraugus County 77042
6 Cayuga County 76248
Join hate2 data with nypop
hate_new <- hate2 |>mutate(county =as_factor(str_to_lower(as.character(county))))nypop_new <- nypop2 |>mutate(county =as_factor(str_to_lower(as.character(county)))) #enure that counties are in lowercasedatajoin <-left_join(hate_new, nypop_new, by=c("county"))datajoin
# A tibble: 143 × 5
# Groups: complaint_year_number, county [40]
complaint_year_number county bias_motive_description n
<dbl> <fct> <chr> <int>
1 2024 kings ANTI-JEWISH 151
2 2025 kings ANTI-JEWISH 142
3 2024 new york ANTI-JEWISH 137
4 2019 kings ANTI-JEWISH 128
5 2023 kings ANTI-JEWISH 126
6 2022 kings ANTI-JEWISH 125
7 2025 new york ANTI-JEWISH 124
8 2023 new york ANTI-JEWISH 123
9 2022 new york ANTI-JEWISH 104
10 2021 new york ANTI-ASIAN 84
# ℹ 133 more rows
# ℹ 1 more variable: X_2020_census_population <int>
Calculate rate of incidents per 100,000 and arrange in descending order
# A tibble: 143 × 6
# Groups: complaint_year_number, county [40]
complaint_year_number county bias_motive_description n
<dbl> <fct> <chr> <int>
1 2024 kings ANTI-JEWISH 151
2 2025 kings ANTI-JEWISH 142
3 2024 new york ANTI-JEWISH 137
4 2019 kings ANTI-JEWISH 128
5 2023 kings ANTI-JEWISH 126
6 2022 kings ANTI-JEWISH 125
7 2025 new york ANTI-JEWISH 124
8 2023 new york ANTI-JEWISH 123
9 2022 new york ANTI-JEWISH 104
10 2021 new york ANTI-ASIAN 84
# ℹ 133 more rows
# ℹ 2 more variables: X_2020_census_population <int>, rate <dbl>
Summary
The hate crimes dataset, “NYC hate crimes 2019-2026”, by R Saidi acknowledges that hate crime data collection is flawed as local law enforcement agencies cannot be compelled to submit data to the Federal Bureau of Information (FBI). In consideration of this flaw in data, the positive aspects of this dataset are the ways in which the flaws of hate crime data collection is shown. An example of this is the disproportion in the reported bias motive descriptions being majorly anti-Jewish. This gap is even more evident in its visualization as a bar graph as Jewish hate crimes exceed 1500 but other hate crimes against gay males, Asian people, and black people do not exceed 500. The acknowledgement of flawed data collection is sufficient to assume a bias in reporting of hate crimes. On the other hand, the negative aspects of this data set is the mistake of heading bar graphs with the years between 2010-2016 when the data covers 2019 to 2026. Two different paths I would like to hypothetically study about this data set are the demographics of the population and the rate of hate crimes outside of New York and Kings counties.