Skip to contents

Chains mrm_uof_weapon_diversity over Weapon x Location (the only two categorical columns the file publishes) plus a Weapon-only frequency table plus a data-quality audit.

Usage

morie_arsau_analyze_weapon_records(
  year,
  allow_invalid = FALSE,
  language = "en",
  data_dir = NULL
)

Arguments

year

2023 or 2024.

allow_invalid

Logical; required TRUE for 2023.

language

"en" or "fr".

data_dir

Optional explicit ARSAU root.

Value

A list classed c("morie_arsau_result", "morie_rich_result", "list").

Details

The 2023 file is the ministry-flagged-invalid release and requires allow_invalid = TRUE.

References

Ontario Ministry of the Solicitor General, ARSAU 2023 and 2024 weapon_records technical notes – the 2023 release accompanies an explicit invalidity flag.

Examples

# \donttest{
res <- try(morie_arsau_analyze_weapon_records(year = "2024"))
if (!inherits(res, "try-error")) print(res)
#> ARSAU weapon_records analysis (2024)
#> ====================================
#> Call: morie_arsau_analyze_weapon_records(year=‘2024’, allow_invalid=FALSE) 
#> 
#>   Year/range        2024
#>   Kind              weapon_records
#>   Rows analysed     5
#>   Columns analysed  5
#>   Valid             yes
#>   Sub-analyses      3
#> 
#> Warning: [weapon_x_location] 20 of 20 expected cell(s) below 5; chi-square approximation may be unreliable. 
#> 
#> Ran 3 sub-analysis(es) over the ARSAU 'weapon_records' dataset for '2024': weapon_x_location, weapon_frequencies, data_quality. Each sub-result is available as `result$<name>` and the underlying data.frame as `result$data`. 
# }