
Fallback Absolute Difference Between Two Vectors (type-preserving)
Source:R/utils.R
fallback_diff.RdComputes the difference between two numeric or integer vectors element-wise.
If both values are present, returns pmax(abs(col1 - col2), minimum).
If only one value is present, returns the non-missing value or minimum,
whichever is greater. If both are missing, returns NA of the
appropriate type.
Value
An integer or numeric vector with the same length as the inputs. Each element is:
the absolute difference between
col1andcol2, if both are non-missing,the non-missing value if only one is present,
NA_integer_orNA_real_if both are missing.
In all cases, the result is constrained to be no less than minimum.