
Check consistency between a deterministic RSG assignment and a spatial prior
Source:R/spatial-sanity.R
prior_consistency_check.RdReturns a list describing whether the assigned RSG is plausible under the given prior. The deterministic classification is never overridden – this is purely a sanity-check signal.
Arguments
- rsg_code
Two-letter RSG code (e.g.
"FR"). Either thersg_or_orderfrom aClassificationResult(in which case it must be the RSG name; we try to translate via the trace) or the bare code from a key trace entry.- prior
A spatial-prior data.table from
spatial_prior.- threshold
Probability below which an assignment is flagged inconsistent (default 0.01).
Value
A list with elements:
consistent:TRUE/FALSE/NA.p: probability of the assigned RSG in the prior (orNA_real_if not found).threshold: the threshold used.status: a short status string –"consistent","inconsistent", or"no_data".note: human-readable explanation.top_prior:data.tablewith the top three classes from the prior (for messages).