Description Usage Arguments Details
Returns the euclidean distance between two vector.
1 2 3 4 5 6 7 8 9 10 | distEuclid(x, ...)
## S3 method for class 'numeric'
distEuclid(x, y)
## S3 method for class 'matrix'
distEuclid(x, y)
## S3 method for class 'data.frame'
distEuclid(x, y)
|
x, y |
Points between which the distance is computed. |
if x
is a vector or a matrix with one row, the funtion
returns vector with the same number of observations as y
corresponding to the
distance with x
. If x
and y
are both
matrices of the same size, the function returns distance between
each row.
@examples
x1 <- replicate(2,rnorm(5)) x2 <- replicate(2,rnorm(5))
distEuclid(x1[1,], x2) distEuclid(x1, x2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.