Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

metric.dist

Distance Matrix Computation


Description

This function computes the distances between the rows of a data matrix by using the specified distance measure.

This function returns a distance matrix by using dist function.
The matrix dimension is (n1 x n1) if y=NULL, (n1 x n2) otherwise.

Usage

metric.dist(x, y = NULL, method = "euclidean", p = 2, dscale = 1, ...)

Arguments

x

Data frame 1. The dimension is (n1 x m).

y

Data frame 2. The dimension is (n2 x m).

method

The distance measure to be used. This must be one of "euclidean", "maximum", "manhattan", "canberra", "binary" or "minkowski".

p

The power of the Minkowski distance.

dscale

If scale is a numeric, the distance matrix is divided by the scale value. If scale is a function (as the mean for example) the distance matrix is divided by the corresponding value from the output of the function.

...

Further arguments passed to dist function.

Author(s)

Manuel Febrero-Bande, Manuel Oviedo de la Fuente manuel.oviedo@usc.es

See Also

See also dist for multivariate date case and metric.lp for functional data case

Examples

## Not run: 
data(iris)
d<-metric.dist(iris[,1:4])
matplot(d,type="l",col=as.numeric(iris[,5]))

## End(Not run)

fda.usc

Functional Data Analysis and Utilities for Statistical Computing

v2.0.2
GPL-2
Authors
Manuel Febrero Bande [aut], Manuel Oviedo de la Fuente [aut, cre], Pedro Galeano [ctb], Alicia Nieto [ctb], Eduardo Garcia-Portugues [ctb]
Initial release
2020-02-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.