Skip to contents

Reads the manifest of every saved scenario and looks up the model it references in the model store: one row per scenario, with the state of its reference. No scenario and no model is loaded, and nothing is written (the registry is not refreshed).

Status: ok – the recorded version is where the reference says; moved – that version is in the store at another path (the scenario loads; relink_scenario() updates the path); name_only – the store has a model of that name but not the recorded version, so load_scenario() loads the current one with a warning; missing – no model of that name, so the scenario does not load; embedded – the scenario carries its own copy of the model and references nothing.

Usage

check_scenario_models(path = get_scenarios_path(), verbose = isVerbose())

Arguments

path

the scenarios store to scan (default get_scenarios_path()), or the folders of the scenarios to check. A folder holding a scenario.yml is a scenario; any other is scanned one level down.

verbose

logical; TRUE prints a summary of the statuses.

Value

a tibble: scenario (name), path (its folder), model and hash (the recorded model name and 8 characters of its hash), status, current (for name_only: 8 characters of the hash the store holds under that name), found (for moved: where the version is) and candidates (for name_only and missing: the stored versions to relink to, as name@hash8, "; "-separated).

See also

relink_scenario(), load_scenario(model = ), list_dependents() for the same references read from the model's side.

Examples

if (FALSE) { # \dontrun{
open_project(tempdir())

chk <- check_scenario_models()
chk[chk$status %in% c("name_only", "missing"), ]
} # }