L1.dist: Apply the L1 distance function to two scores.

View source: R/gower.R

L1.distR Documentation

Apply the L1 distance function to two scores.

Description

Apply the L1 distance function to two scores.

Usage

L1.dist(x, y, range)

Arguments

x

a score.

y

a score.

range

the range of the scores, i.e., the difference between the maximum score and the minimum score.

Details

This function applies the L1 distance function to two scores. This is an appropriate distance function for ordinal data.

Value

|x - y| / r, where r is the range of the scores; or NA if either score is NA.

See Also

discrete.dist


goweragreement documentation built on May 29, 2024, 7:11 a.m.