Learn R Programming

genscore (version 1.0.2)

diff_vecs: Computes the sum of absolute differences in the finite non-NA/NULL elements between two vectors.

Description

Computes the sum of absolute differences in the finite non-NA/NULL elements between two vectors.

Usage

diff_vecs(l1, l2, relative = FALSE)

Value

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.

Arguments

l1

A vector.

l2

A vector.

relative

A boolean, default to FALSE. If TRUE, returns the relative difference (sum of absolute differences divided by the elementwise minimum between l1 and l2).