distancia {dprep}R Documentation

Vector-Vector Euclidiean Distance Function

Description

Finds the euclidean distance between two vectors x and y, or the vector x and the matrix y

Usage

distancia(x, y)

Arguments

x A numeric vector
y A numeric vector or matrix

Details

Does not support missing values.

Value

distancia The result is a numeric value representing the Euclidean distance between x and y, or a row matrix representing the Euclidean distance between x and each row of y.

Author(s)

Caroline Rodriguez and Edgar Acuna

Examples

#---- Calculating distances
x=rnorm(4)
y=matrix(rnorm(12),4,3)
distancia(x,y[,1])
distancia(x,y)

[Package dprep version 2.0 Index]