Predict blank class-reference values with reviewed regex rules
Source:R/build_lib.R
predict_class_reference.RdApplies a separate regex reference only to rows whose material is blank.
Populated exact materials are authoritative and are never overwritten, even
when a regex also matches them. A blank row is filled only when all matching
patterns name one material. Distinct-material matches remain blank and are
reported as clashes. Exact/regex overlaps are allowed and reported for QA.
If present, match_identity is used for pattern matching while
spectrum_identity remains the reported exact identity.
Usage
predict_class_reference(
metadata,
regex_reference,
return = c("table", "report")
)Arguments
- metadata
A data.frame or data.table with
spectrum_identityandmaterialcolumns. Row order is preserved.- regex_reference
A data.frame or data.table with unique
patternand nonblankmaterialcolumns.- return
Return the updated table or an audit containing
data,summary,predictions,clashes, andoverlaps.