Created
October 7, 2021 12:54
-
-
Save chasemc/7489860cc43aef3df8c6ca4dcd7edec0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(data.table) | |
library(ggplot2) | |
library(lubridate) | |
df <- fread("Shootings.csv") | |
df$hour = lubridate::hour(lubridate::mdy_hms(df$Date)) | |
new_df <- df[, list(arrest = sum(Arrest), no_arrest = sum(!Arrest), total_reports = length(Arrest)), Year] | |
ggplot(new_df) + | |
geom_point(aes(x = Year,y = arrest/total_reports)) + | |
coord_cartesian(ylim=c(0, 0.15)) + | |
ylab("Arrest / Total Reports") | |
ggplot(new_df) + | |
geom_point(aes(x = Year,y = total_reports)) + | |
ylab("Total Reports") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment