High-level classification entry point. Pre-computes the implemented
diagnostic horizons (argic, ferralic, mollic) for transparent
reporting, runs the key, and assembles a
ClassificationResult with the trace, ambiguities,
missing-data hints, evidence grade, and (in future) prior sanity
check.
Usage
classify_wrb2022(
pedon,
prior = NULL,
prior_threshold = 0.01,
on_missing = c("warn", "silent", "error"),
rules = NULL,
strict = NULL,
specifiers = FALSE,
gapfill = FALSE
)Arguments
- pedon
A
PedonRecord.- prior
Optional spatial prior – a
data.tablewith columnsrsg_codeandprobability, typically the return value ofspatial_prior. If supplied, the result records aprior_checkentry fromprior_consistency_check; an inconsistent prior also emits a warning. The deterministic key is NEVER overridden by the prior.- prior_threshold
Probability below which the prior triggers an "inconsistent" warning (default 0.01).
- on_missing
One of
"warn"(default),"silent","error". Behaviour when the trace reports missing attributes.- rules
Optional pre-loaded rule set.
- strict
Logical or
NULL. Controls WRB Tier-3 strict mode for the per-RSG numerical gates (Vertisols, Andosols, Gleysols, Planosols, Ferralsols, Chernozems, Kastanozems). WhenNULL(default) the gates followgetOption("soilKey.rsg_strict", FALSE). PassingTRUEorFALSEforces strict mode on or off for the duration of this call; see the individual RSG-gate help pages (e.g.ferralsol) for the strengthened thresholds.- specifiers
Logical. When
TRUE, auto-attach WRB 2022 Ch 5 depth specifiers (Epi-/Endo-/Bathy-/Amphi-/Panto-/Kato-) to depth-anchored qualifiers based on the diagnostic feature's actual depth – e.g. a gleyic feature confined to 50–100 cm yieldsEndogleyicinstead ofGleyic. DefaultFALSEkeeps the canonical names byte-identical. Surface / epipedon qualifiers are excluded (their depth is definitional).- gapfill
Opt-in within-pedon depth gap-fill, default
FALSE(no-op, classification stays byte-identical).TRUEfills interiorNAcells of the continuous depth-trending attributes by linear interpolation from the profile's own measured horizons; a character vector restricts it to those attributes; a named list is passed togapfill_within_pedon. Filled cells carryinferred_priorprovenance, so the evidence grade drops to"C". Runs on a deep copy – the caller's pedon is never mutated.
Examples
pedon <- make_ferralsol_canonical()
res <- classify_wrb2022(pedon)
res$name
#> [1] "Geric Ferric Rhodic Ferralsol (Clayic, Humic, Eutric, Ochric, Rubic)"
