
How concentrated is crime across Toronto's 158 neighbourhoods?
Source:R/tps_all_analyze.R
morie_tps_neighbourhood_concentration.RdUses HOOD_158 (the 158-neighbourhood scheme) and reports a Gini coefficient plus the cumulative share of incidents in the top-10 and top-20 neighbourhoods.
Examples
# \donttest{
df <- try(morie_datasets_tps_assault(max_features = 200L))
if (!inherits(df, "try-error")) {
res <- try(morie_tps_neighbourhood_concentration(df, ds_name = "assault"))
if (!inherits(res, "try-error")) str(res, max.level = 1)
}
#> List of 8
#> $ title : chr "TPS neighbourhood concentration -- assault"
#> $ call : NULL
#> $ summary_lines :List of 4
#> $ tables :List of 1
#> $ warnings : chr(0)
#> $ interpretation: chr "Gini = 0.000 measures how unequally incidents are distributed across neighbourhoods. Higher = more concentrated"| __truncated__
#> $ payload :List of 5
#> $ sections : list()
#> - attr(*, "class")= chr [1:3] "morie_tps_result" "morie_rich_result" "list"
# }