Adds or retrieves a unit of measure (UoM) attribute to a vector. Units
provide semantic meaning for numeric or character data — such as currency,
weight, or time — helping prevent incorrect operations like merging values
measured in incompatible units.
The var_unit<- assignment method sets, updates, or removes the "unit"
attribute of a vector. This can be used with defined() vectors or base
vectors to ensure consistent semantic annotation.
unit_attribute() is a low-level helper to directly access the "unit"
attribute of a vector, without applying fallback logic. It is mainly used
internally.
get_unit_attribute() is an alias for unit_attribute(), included for naming
consistency in codebases that distinguish getter/setter patterns.
set_unit_attribute() is the low-level assignment function that sets or
removes the "unit" attribute of an object. Used internally by
unit_attribute<-.