Rows: 4029 Columns: 14
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (9): Record Create Date, Patrol Borough Name, County, Law Code Category ...
dbl (4): Full Complaint ID, Complaint Year Number, Month Number, Complaint P...
lgl (1): Arrest 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=biasmotivedescription, y = n)) +geom_col()
bias_count |>head(10) |>ggplot(aes(x=reorder(biasmotivedescription, n), y = n)) +geom_col() +coord_flip() #switch the axis position
#reorder, display in the order based on n
bias_count |>head(10) |>ggplot(aes(x=reorder(biasmotivedescription, 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")
bias_count |>head(10) |>ggplot(aes(x=reorder(biasmotivedescription, 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()
bias_count |>head(10) |>ggplot(aes(x=reorder(biasmotivedescription, 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: 127 × 4
# Groups: complaintyearnumber, county [35]
complaintyearnumber county biasmotivedescription n
<dbl> <chr> <chr> <int>
1 2024 KINGS ANTI-JEWISH 152
2 2024 NEW YORK ANTI-JEWISH 136
3 2025 KINGS ANTI-JEWISH 136
4 2019 KINGS ANTI-JEWISH 128
5 2023 KINGS ANTI-JEWISH 126
6 2022 KINGS ANTI-JEWISH 125
7 2023 NEW YORK ANTI-JEWISH 124
8 2025 NEW YORK ANTI-JEWISH 110
9 2022 NEW YORK ANTI-JEWISH 104
10 2021 NEW YORK ANTI-ASIAN 84
# ℹ 117 more rows
ggplot(data = hate2) +geom_bar(aes(x=complaintyearnumber, y=n, fill = biasmotivedescription),position ="dodge", stat ="identity") +#keep the previous calculationlabs(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")
ggplot(data = hate2) +geom_bar(aes(x=county, y=n, fill = biasmotivedescription),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")
ggplot(data = hate2) +geom_bar(aes(x=complaintyearnumber, y=n, fill = biasmotivedescription),position ="dodge", stat ="identity") +facet_wrap(~county) +#separate the graph into graphs per countylabs(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")
nypop <-read_csv("nyc_census_pop_2020.csv")
Rows: 62 Columns: 4
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (2): Area Name, Population Percent Change
num (2): 2020 Census Population, Population Change
ℹ 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.
# A tibble: 127 × 5
# Groups: complaintyearnumber, county [35]
complaintyearnumber county biasmotivedescription n 2020 Census Populati…¹
<dbl> <chr> <chr> <int> <dbl>
1 2024 KINGS ANTI-JEWISH 152 NA
2 2024 NEW Y… ANTI-JEWISH 136 NA
3 2025 KINGS ANTI-JEWISH 136 NA
4 2019 KINGS ANTI-JEWISH 128 NA
5 2023 KINGS ANTI-JEWISH 126 NA
6 2022 KINGS ANTI-JEWISH 125 NA
7 2023 NEW Y… ANTI-JEWISH 124 NA
8 2025 NEW Y… ANTI-JEWISH 110 NA
9 2022 NEW Y… ANTI-JEWISH 104 NA
10 2021 NEW Y… ANTI-ASIAN 84 NA
# ℹ 117 more rows
# ℹ abbreviated name: ¹`2020 Census Population`
# A tibble: 127 × 5
# Groups: complaintyearnumber, county [35]
complaintyearnumber county biasmotivedescription n 2020 Census Populati…¹
<dbl> <fct> <chr> <int> <dbl>
1 2024 kings ANTI-JEWISH 152 NA
2 2024 new y… ANTI-JEWISH 136 NA
3 2025 kings ANTI-JEWISH 136 NA
4 2019 kings ANTI-JEWISH 128 NA
5 2023 kings ANTI-JEWISH 126 NA
6 2022 kings ANTI-JEWISH 125 NA
7 2023 new y… ANTI-JEWISH 124 NA
8 2025 new y… ANTI-JEWISH 110 NA
9 2022 new y… ANTI-JEWISH 104 NA
10 2021 new y… ANTI-ASIAN 84 NA
# ℹ 117 more rows
# ℹ abbreviated name: ¹`2020 Census Population`
datajoinrate <- datajoin |>mutate(rate = n/`2020 Census Population`*100000) |>arrange(desc(rate))datajoinrate
# A tibble: 127 × 6
# Groups: complaintyearnumber, county [35]
complaintyearnumber county biasmotivedescription n 2020 Census Populati…¹
<dbl> <fct> <chr> <int> <dbl>
1 2024 kings ANTI-JEWISH 152 NA
2 2024 new y… ANTI-JEWISH 136 NA
3 2025 kings ANTI-JEWISH 136 NA
4 2019 kings ANTI-JEWISH 128 NA
5 2023 kings ANTI-JEWISH 126 NA
6 2022 kings ANTI-JEWISH 125 NA
7 2023 new y… ANTI-JEWISH 124 NA
8 2025 new y… ANTI-JEWISH 110 NA
9 2022 new y… ANTI-JEWISH 104 NA
10 2021 new y… ANTI-ASIAN 84 NA
# ℹ 117 more rows
# ℹ abbreviated name: ¹`2020 Census Population`
# ℹ 1 more variable: rate <dbl>
The hate crimes dataset has both positive and negative aspects. One positive aspect is that it provides detailed information about the specific bias motivations behind reported hate crimes. This allows us to look at different categories, such as anti-Jewish, anti-Asian, anti-Black, and anti-male homosexual bias, instead of treating all hate crimes as one group. Another positive aspect is that the dataset covers multiple years, which allows us to look for patterns and changes over time.
One negative aspect is that some information may be missing or inconsistent. For example, we saw that the county names were not always written in the same format, such as “KINGS” and “Kings.” This can create problems when combining the hate crimes data with other datasets. Another negative aspect is that the dataset does not necessarily explain why a hate crime happened or what factors caused it. It mainly provides information about reported incidents, so we have to be careful when making conclusions about causes.
If I could study this dataset further, I would first look at the relationship between county population and reported hate crimes. I would also compare the different bias motivations across counties to see whether certain types are more common in particular areas.