Chapter 24 Trend of Battery - Simple Assault
We examine the Trend of the Crime Battery - Simple Assault from 2010 onwards. We choose this Crime Type since it is the most commonly occuring Crime Type.We exclude the last Month since it might be a outlier.
LACrimeGroupBatterySA = LACrime %>%
filter(CrimeCode == 624) %>%
mutate(year_month = make_date(year=year(mdy(DateOccurred)),month=month(mdy(DateOccurred))) ) %>%
filter(!is.na(year_month)) %>%
filter(year_month != "2017-09-01") %>%
group_by(year_month) %>%
summarize(CountCrimes = n())
LACrimeGroupBatterySA %>% filter(year_month != "2017-09-01") %>%
ggplot(aes(x=year_month,y=CountCrimes)) +
geom_line(size=.5, color="red")+geom_point(size=2, color="red")+theme_bw()