Learn R Programming

RSDA (version 2.0.4)

dist: Generic function for distance matrix computation

Description

Generic function for distance matrix computation

Usage

dist(x, ...)

# S3 method for default dist(x, method = "euclidean", diag = FALSE, upper = FALSE, p = 2, ...)

# S3 method for sym.data.table dist(x, q = 2, ...)

Arguments

x

An R object. Currently the are methods for numeric matrix, data.frame, dist object or symbolic data table

...

Further arguments passed to or from other methods

method

the distance measure to be used. This must be one of "euclidean", "maximum", "manhattan", "canberra", "binary" or "minkowski". Any unambiguous substring can be given.

diag

logical value indicating whether the diagonal of the distance matrix should be printed by print.dist.

upper

logical value indicating whether the upper triangle of the distance matrix should be printed by print.dist.

p

The power of the Minkowski distance.

q

q value for the Minkowski method

Value

dist returns an object of class 'dist'