Welcome to this data story about recorded offences in Victoria, Australia.
We will explore how crime changes over time and across regions using open data.
crime_division <- crime %>%
group_by(division) %>%
summarise(total_offences = sum(count, na.rm = TRUE)) %>%
arrange(desc(total_offences))
ggplot(crime_division, aes(x = reorder(division, total_offences), y = total_offences)) +
geom_col() +
coord_flip() +
labs(
title = "Total Recorded Offences by Division",
x = "Offence division",
y = "Total offences"
) +
theme_minimal()crime_subgroup <- crime %>%
group_by(subgroup) %>%
summarise(total_offences = sum(count, na.rm = TRUE)) %>%
arrange(desc(total_offences)) %>%
slice_head(n = 10)
ggplot(crime_subgroup, aes(x = reorder(subgroup, total_offences), y = total_offences)) +
geom_col() +
coord_flip() +
labs(
title = "Top 10 Offence Subgroups by Recorded Offences",
x = "Offence subgroup",
y = "Total offences"
) +
theme_minimal()crime_div_time <- crime %>%
group_by(year, division) %>%
summarise(total = sum(count, na.rm = TRUE))## `summarise()` has grouped output by 'year'. You can override using the
## `.groups` argument.