Chapter 23 Trend of Crimes
We examine the Trend of the Crimes from 2010 onwards
LACrimeGroup = LACrime %>%
mutate(year_month = make_date(year=year(mdy(DateOccurred)),month=month(mdy(DateOccurred))) ) %>%
filter(!is.na(year_month)) %>%
group_by(year_month) %>% summarize(CountCrimes = n())
LACrimeGroup %>% 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()
The crimes are increasing from 2014 onwards.