
Compare counts and trends across multiple TPS categories
Source:R/tps_all_analyze.R
morie_tps_crime_compare.RdAccepts a named list of TPS data.frames (e.g.
list(Assault = df_a, Robbery = df_r, ...)) and returns a
morie_tps_result with a total-counts table and (when
OCC_YEAR is present in every frame) a side-by-side
year-by-year matrix.
Examples
# \donttest{
df <- try(morie_datasets_tps_assault(max_features = 200L))
if (!inherits(df, "try-error")) {
res <- try(morie_tps_crime_compare(list(assault = df)))
if (!inherits(res, "try-error")) str(res, max.level = 1)
}
#> List of 8
#> $ title : chr "TPS -- cross-category comparison"
#> $ call : NULL
#> $ summary_lines :List of 2
#> $ tables :List of 2
#> $ warnings : chr(0)
#> $ interpretation: chr "Compared 1 TPS category carrying 5 total incident-row(s)."
#> $ payload : list()
#> $ sections : list()
#> - attr(*, "class")= chr [1:3] "morie_tps_result" "morie_rich_result" "list"
# }