Check metadata/variable.csv against metadata/measurement_type.csv
Source: R/registry.R
check_variable_registry.RdThree standing invariants a measurement page (D6) needs to hold, checked together so a single run reports every violation rather than stopping at the first:
Details
every non-
NAmeasurement_type.variablevalue has exactly onevariable.csvrow — no crosswalk key is orphanedevery
variable.csvrow has >= 1 member series inmeasurement_type.csv— no unused key shipsa row's
nerc_p01, when set, equals every member series' ownnerc_p01(an empty row value is always allowed — seeregister_variables()for why a genuine member disagreement is recorded that way, not as an error)a key's member series carry the same units, or a known-equivalent spelling (
PSS-78/PSU— the same practical salinity scale under two names; the CalCOFI bottle and the CTD's own processing software write it differently)
See also
register_variables(), which enforces the nerc_p01 half of this
at write time.