Convenience wrapper that runs classify_wrb2022,
classify_sibcs, and classify_usda on the same
PedonRecord and returns a single named list with one entry
per system (plus a summary table that's handy for reports).
Usage
classify_all(
pedon,
systems = "all",
on_missing = c("warn", "silent", "error"),
include_familia = TRUE,
include_family = FALSE,
specifiers = FALSE,
gapfill = FALSE,
...
)Arguments
- pedon
A
PedonRecord.- systems
Character vector. Any subset of
c("wrb2022", "sibcs", "usda"), or the literal"all"(default) to run every system.- on_missing
One of
"warn"(default),"silent","error". Forwarded verbatim to each classifier.- include_familia
Forwarded to
classify_sibcs(defaultTRUE). Has no effect on the other systems.- include_family
Forwarded to
classify_usda(defaultFALSE) to derive the USDA 5th-level family. No effect on the other systems.- specifiers
Forwarded to
classify_wrb2022(defaultFALSE) to auto-attach WRB depth specifiers. No effect on the other systems.- gapfill
Forwarded to all three classifiers (default
FALSE=> byte-identical). Opt-in within-pedon depth gap-fill; seegapfill_within_pedon. Applied independently per system on a deep copy, so the caller's pedon is never mutated.- ...
Additional named arguments are silently ignored.
Value
A named list with elements:
wrb–ClassificationResultfromclassify_wrb2022()(orNULLif the system was skipped or errored).sibcs– as above, fromclassify_sibcs().usda– as above, fromclassify_usda().summary– a 1-rowdata.framewith one column per system, holding the resulting$name(orNAwhen the system was skipped / errored). Useful for tabulating many pedons in one shot.
Details
Each classifier still produces its own ClassificationResult
with the full key trace and evidence grade – nothing is collapsed or
homogenised. The wrapper exists for ergonomics, not abstraction.
Selecting a subset of systems
Pass systems = c("wrb2022", "sibcs") (or any other subset) to skip
systems you don't need. Default systems = "all" runs all three.
Errors and partial results
If a single classifier raises an error, the corresponding slot of the
returned list is set to NULL and a one-line warning is emitted (so
you can rerun the offender on its own to see the full traceback). The
other classifiers still run and their results are returned. This matches
the spirit of on_missing = "warn" on the individual classifiers.
Side effects
None. The classifiers do not mutate pedon; the wrapper does not
attach any side-channel state.
Examples
pr <- make_ferralsol_canonical()
all_three <- classify_all(pr)
all_three$summary
#> wrb
#> 1 Geric Ferric Rhodic Ferralsol (Clayic, Humic, Eutric, Ochric, Rubic)
#> sibcs usda
#> 1 Latossolos Vermelhos Distroficos tipicos, argilosa, moderado Rhodic Hapludox
# WRB + USDA only (skip SiBCS):
classify_all(pr, systems = c("wrb2022", "usda"))$summary
#> wrb sibcs
#> 1 Geric Ferric Rhodic Ferralsol (Clayic, Humic, Eutric, Ochric, Rubic) <NA>
#> usda
#> 1 Rhodic Hapludox
