distancia1: Vector-Vector Manhattan Distance Function

Description Usage Arguments Details Value Author(s) Examples

View source: R/distancia1.R

Description

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

Usage

1
distancia1(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 Manhattan distance between x and y, or a row matrix representing the Euclidean distance between x and each row of y.

Author(s)

Edgar Acuna

Examples

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

dprep documentation built on May 29, 2017, 11:01 a.m.