Calculate the distance between two vector of the same length using the chosen distance function.

distanceBetween(x, y, distance = "euc")

Arguments

x

first vector

y

second vector

distance

distance function used to calculate the distance between the vectors

Value

A positive number that is the distance between the two vectors

Examples

# Uses the default distance function: Euclidean distance distanceBetween(c(1, 2, 3), c(3, 2, 1))
#> [1] 2.828427