Chapter 7 Day of Crime
We examine the days in which Crime has occurred and create a bar plot.
LACrime$DayOfCrime = wday(mdy(LACrime$DateOccurred),label = TRUE)
LACrime %>%
group_by(DayOfCrime) %>%
summarise(CountIncidents = n()) %>%
mutate(DayOfCrime = reorder(DayOfCrime,CountIncidents)) %>%
ggplot(aes(x = DayOfCrime,y = CountIncidents)) +
geom_bar(stat='identity',colour="white", fill =fillColor2) +
geom_text(aes(x = DayOfCrime, y = 1, label = paste0("(",CountIncidents,")",sep="")),
hjust=0, vjust=.5, size = 4, colour = 'black',
fontface = 'bold') +
labs(x = 'Day Of Crime', y = 'Count of Incidents',
title = 'Count of Incidents') +
coord_flip() +
theme_bw()
We observe that Friday has the highest crimes.