Computes the sum of absolute differences in the finite non-NA
/NULL
elements between two vectors.
diff_vecs(l1, l2, relative = FALSE)
The sum of (relative) absolute differences in l1
and l2
, or a positive integer if two vectors differ in length or hold NA
, NULL
or Inf
values in different places.
A vector.
A vector.
A boolean, default to FALSE
. If TRUE
, returns the relative difference (sum of absolute differences divided by the elementwise minimum between l1
and l2
).