Skip to contents

Computes the distance between two numeric or binary vectors.

Usage

distance(x = NULL, y = NULL, distance = "euclidean")

Arguments

x

(required, numeric vector).

y

(required, numeric vector) of same length as x.

distance

(optional, character string) name or abbreviation of the distance method. Valid values are in the columns "names" and "abbreviation" of the dataset distances. Default: "euclidean".

Value

numeric value

Examples


distance(
  x = runif(100),
  y = runif(100),
  distance = "euclidean"
)
#> [1] 4.163744