Skip to contents

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.

Usage

cli_main(subject, json = "{}")

Arguments

subject

Character scalar naming the analysis subject.

json

Character scalar: a JSON object of options forwarded from the CLI flags (default "{}"). Unknown keys are ignored.

Value

Invisibly, the analysis result (a list). As a side effect, prints that result to stdout as JSON.

Details

Supported subjects:

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":[]}}
# }