Single R-side dispatcher for the proprietary rmorie-cli binary's
rmorie analyze <subject> verb. The CLI shells out with
Rscript -e 'rmorie::cli_main("<subject>", "<json>")' and forwards
the parsed command-line flags as one JSON object; this function loads the
subject's data, runs the corresponding analysis suite, and prints the
result to stdout as JSON. It is not intended for interactive use.
Value
Invisibly, the analysis result (a list). As a side effect, prints
that result to stdout as JSON.
Details
Supported subjects:
"otis"– Ontario OTIS carceral data. Loads the bundled OTIS fixture (offline) and runsmorie_otis_all_analyses; theyearflag is forwarded."siu"– Special Investigations Unit; runsmorie_siu_all_analyses."nypd"– New York Police Department; runsmorie_nypd_all_analyses(bundled samples offline)."cpd"– Chicago Police Department; runsmorie_cpd_all_analyses(bundled samples offline).
The "tps" subject is recognised by the CLI but needs an explicit
dataset selection, so it returns a structured, non-crashing message
pointing at the R API.
Examples
# \donttest{
cli_main("otis", "{}")
#> {"rplace":{"title":"otis.rplace (failed)","warnings":"getvarError: argument \"year\" is missing, with no default"},"astcmb":{"title":"OTIS alert-state combinations","summary_lines":[],"tables":[],"interpretation":"","warnings":"missing column(s): mental_health_alert, suicide_risk_alert, suicide_watch_alert, unique_individual_id, end_fiscal_year","payload":[]},"volat":{"title":"OTIS regional volatility","summary_lines":[],"tables":[],"interpretation":"","warnings":"missing column(s): unique_individual_id, end_fiscal_year, region_at_time_of_placement","payload":[]},"rctrnd":{"title":"OTIS restrictive-confinement trends","summary_lines":[],"tables":[],"interpretation":"","warnings":"missing column(s): unique_individual_id, end_fiscal_year, region_at_time_of_placement","payload":[]},"otdesc":{"title":"OTIS descriptives","summary_lines":[],"tables":[],"interpretation":"","warnings":"missing id col 'unique_individual_id'","payload":[]}}
# }
