Guess a column's type from its values and its name
Source:R/02-02-classify-by-name.R
guess_column.RdRuns both detection modalities and reconciles them VALUES-FIRST: if a value
detector clears threshold, its (format-anchored) answer is returned; only
when no value detector is confident does the name classifier fill in the
class. This is what lets the metadata-gated classes – a double column
named sampling_weight, a 0/1 column named eligible – be typed at all,
while never letting a misleading name override a real value signature.
Arguments
- x
A vector (coerced to character) of column values.
- name
Optional variable name (header string).
- threshold
Minimum value-detector pass rate to trust the value guess.
- ...
Passed to
guess_data_type().
Value
A list with source ("value", "name", or "none"), guess,
ontology (the standard 4-vector), confidence, and the full value and
name sub-results for inspection.