:
library(dplyr)
df_cantonlarcauto_missing = data_frame(CrimeDate = seq(min(df_cantonlarcauto$CrimeDate), max(df_cantonlarcauto$CrimeDate), 1)) %>%
left_join(df_cantonlarcauto)
(ggplot (df_cantonlarcauto_missing, aes (x = CrimeDate, y = , group = 1)) +...), .
, , , , 0 , - (, ), /0
df_cantonlarcauto_missing = data_frame(CrimeDate = seq(min(df_cantonlarcauto$CrimeDate), max(df_cantonlarcauto$CrimeDate), 1)) %>%
left_join(df_cantonlarcauto) %>%
mutate(crimes = ifelse(is.na(crimes), 0, crimes)) %>%
mutate(crimes = c(rep(NA, 6), rollmean(crimes, 7, align = "right")))
ggplot(df_cantonlarcauto_missing, aes(x = CrimeDate, y = crimes, group=1)) +
geom_line() +
scale_size_area() +
stat_smooth(method = "gam") +
xlab("Year") +
ylab("Number of Crimes") +
theme(plot.title = element_text(family = "Trebuchet MS", color="#666666", face="bold", size=32, hjust=0)) +
theme(axis.title = element_text(family = "Trebuchet MS", color="#666666", face="bold", size=22)) +
ggtitle("Larceny From Auto\nCanton (2010-2014)")
