Skip to contents

The deterministic SIU core runs in rmoriebricklayer when it is installed and current (engine = "auto"), else in this package's own compiled copy of the same C++ core – engine = "bricklayer" or "native" forces one. Text extraction and parsing need bricklayer >= 0.6.0 under "auto": the native core additionally normalises CRLF line endings and reads the real signature block. morie_siu_schema() lists the 16 panel-reviewed fields (count fields flagged: 0 is a real answer). morie_siu_html_to_text() strips tags, scripts and entities while keeping line structure. morie_siu_to_iso_date() converts "January 5, 2023" to "2023-01-05". morie_siu_strip_boilerplate() removes the privacy paragraph and the witness-officer glossary note (native core). morie_siu_report_url() and morie_siu_fetch_report() build and fetch (libcurl) a report page. Parsing and subject-official counts: morie_siu_parse_report, morie_siu_resolve_so.

Usage

morie_siu_schema(engine = "auto")

morie_siu_html_to_text(html, engine = "auto")

morie_siu_to_iso_date(x, engine = "auto")

morie_siu_strip_boilerplate(text)

morie_siu_report_url(drid)

morie_siu_fetch_report(drid, timeout = 30)

Arguments

engine

"auto", "bricklayer" or "native".

html

Report HTML (character scalar).

x

Character vector of human-readable dates.

text

Plain report text.

drid

Director's report id (positive integer).

timeout

Request timeout in seconds.

Value

Data frame (schema) or character (text, dates, url, fetch).

Examples

morie_siu_schema(engine = "native")$name
#>  [1] "police_service"                "date_of_incident_iso"         
#>  [3] "date_siu_notified_iso"         "date_of_director_decision_iso"
#>  [5] "siu_investigators"             "siu_forensics_investigators"  
#>  [7] "number_of_witness_officials"   "number_of_civilian_witnesses" 
#>  [9] "number_of_subject_officials"   "age_affected"                 
#> [11] "sex_gender_affected"           "charges_recommended"          
#> [13] "directors_name"                "location_of_call"             
#> [15] "specific_injuries"             "relevant_legislation"         
morie_siu_to_iso_date(c("January 5, 2023", "not a date"), engine = "native")
#> [1] "2023-01-05" ""