fn extract_unit_from_rvalue(val: &RValue) -> UnitExpand description
Extract a Rust Unit from an R value representing a unit object.
Handles both:
- A unit object (list with class “unit”, fields “value” and “units”)
- A bare numeric vector (treated as NPC by default)