Skip to contents

Pulls the SIU index, walks every linked case-detail page, and writes a six-column CSV (case_number, police_service, incident_iso, notification_iso, decision_iso, director_decision_text, source_url) into cache_dir.

Usage

morie_siu_fetch_cases(
  years = NULL,
  cache_dir = file.path(tempdir(), "morie", "siu"),
  overwrite = FALSE,
  progress = TRUE
)

Arguments

years

Integer vector of fiscal years to scrape, or NULL (default) to scrape the unfiltered index. Years above 2023 (the latest published as of release) may return empty results.

cache_dir

Output directory. Default file.path(tempdir(), "morie", "siu"); pass morie_cache_dir("siu") for persistent caching.

overwrite

Logical; if FALSE and SIU.csv already exists, its path is returned without re-scraping.

progress

Logical; print a one-line status per index / case fetch when TRUE (default).

Value

Path to the written SIU.csv.

Details

This is the lightweight R-only path. For the full 64-column corpus use morie_fetch_siu (compiled C++ harvester).

Examples

if (FALSE) { # \dontrun{
# Network: scrapes the SIU index (~5-15 min at the polite rate).
csv <- morie_siu_fetch_cases(cache_dir = tempfile("siu_"))
utils::head(utils::read.csv(csv))
} # }