dist2All: Distances to all data points

Description Usage Arguments Value Note Author(s)

Description

Calculates all distances from a given vector to the rows of a matrix.

Usage

1
dist2All(x, data, defined, distance)

Arguments

x

A vector containing the data point to be compared to data.

data

A matrix containing the data points to be compared with x.

defined

A vector of the same length as x and the rows of data, containing 1 for all columns of the data to be compared and any other value for columns to be discarded.

distance

A string marking, which distance measure is to be used. Euclidean by default.

Value

distToAll

A vector containing the distances from x to all rows of data.

Note

This function is very inefficient for large Data! For euclidean distance form a given vector to the rows of a matrix use dist2AllEuclid instead.

Author(s)

Raphael Paebst


Mthrun/Distances documentation built on Feb. 4, 2020, 8:39 p.m.