library(ggplot2)
ggplot(ccrb_data, aes(`Incident Year`)) + geom_bar() + ggtitle('Complaints by Years') + xlab('Years') + ylab('Number of Complaints')
We can see from the graph that the number of complaints might not be collected well before 2005. It peaked in 2007 and noticablly and steadily decreased since then.
ggplot(ccrb_data, aes(`Incident Year`, fill = `Borough of Occurrence`)) + geom_bar() + ggtitle('Complaints by Year and Colored with Borough') + xlab('Years') + ylab('Number of Complaints')
The graph shows that over years out off five boroughs, Brooklyn remains the highest number of complaints while Staten Island is the least problematic.
ggplot(ccrb_data, aes(x=ccrb_data$`Borough of Occurrence`)) + geom_bar() + labs(x="Borough of Occurence", y="Number of Incidents", title="Incidents Number by Boroughs")
This graph is incidents by boroughs which proved the previous point. From this graph we can clearly see the comparison between boroughs.
ggplot(ccrb_data, aes(`Incident Year`, fill = `Complaint Filed Mode`)) + geom_bar() + ggtitle('Complaints Methods') + xlab('Years') + ylab('Count')
The graph shows us that the most popular way to file a complaint is by phone and it surpassed other methods by significant amounts.
ggplot(ccrb_data, aes(x=ccrb_data$`Borough of Occurrence`,fill=ccrb_data$`Incident Location`)) + geom_bar(position = "fill") + scale_fill_discrete(name="Incident Location") + labs(x="Borough of Occurence", y="Proportion of Incident (%)", title=" Incident Locations in Each Borough by Percentage")
The graph tells that most of the incidents happened on the streets.
ggplot(data = ccrb_data, aes(x=ccrb_data$`Borough of Occurrence`,fill=ccrb_data$`Encounter Outcome`)) + geom_bar(position = "fill") + scale_fill_discrete(name="Encounter Outcome") + labs(x="Borough of Occurence", y="Proportion of Incident (%)", title="Percentage of Encounter Outcome in Each Borough")
The graph indicates that almost of the cases results in No arrest or Summons.
ccrb_misconducts <- table(ccrb_data$`Allegation FADO Type`)
pie(ccrb_misconducts)
Most reported misconduct of the police is abuse of authority.
ggplot(ccrb_data, aes(x=ccrb_data$`Complaint Has Video Evidence`,fill=ccrb_data$`Encounter Outcome`)) + geom_bar(position = "fill") + scale_fill_discrete(name="Encounter Outcome") + labs(x="Has Video Evidence", y="Proportion of Incident (%)", title="Percentage of Encounter Outcome with/without Video Evidence")
With video evidence it’s slightly easier for police to arrest.
ggplot(ccrb_data, aes(x = `Received Year`, fill = `Complaint Has Video Evidence`)) + geom_bar(position = "stack") + labs(title = "Complaints Counts by Video Evidence over the Years")
There is a trend to have more video evidence
ggplot(ccrb_data, aes(x = `Is Full Investigation`, fill = `Complaint Has Video Evidence`)) + geom_histogram(stat="count") + theme_minimal() + labs(title = "Fully Investigated Complaints with/without Video Evidence")
## Warning: Ignoring unknown parameters: binwidth, bins, pad
Among all complaints, more cases with video evidence have been fully investigated.