Helper to coerce an object to numeric and return a single scalar if possible. If coercion fails, the result is non-finite, or the length is not exactly 1, a default value is returned.
.scalar1(x, default = NA_real_)A numeric scalar or default if extraction fails.
Object to be coerced to numeric.
Numeric scalar returned when a valid scalar cannot
be extracted (default is NA_real_).