dist.xyz {bio3d}R Documentation

Calculate the Distances Between the Rows of Two Matrices

Description

Compute the pairwise euclidean distances between the rows of two matrices.

Usage

dist.xyz(a, b = NULL)

Arguments

a a numeric data matrix of vector
b an optional second data matrix or vector

Details

This function returns a matrix of euclidean distances between each row of ‘a’ and all rows of ‘b’. Input vectors are coerced to three dimensional matrices (representing the Cartesian coordinates x, y and z) prior to distance computation. If ‘b’ is not provided then the pairwise distances between all rows of ‘a’ are computed.

Value

Returns a matrix of pairwise euclidean distances between each row of ‘a’ and all rows of ‘b’.

Note

This function will choke if ‘b’ has too many rows.

Author(s)

Barry Grant

References

Grant, B.J. et al. (2006) Bioinformatics 22, 2695–2696.

See Also

dm, dist

Examples

 dist.xyz( c(1,1,1, 3,3,3), c(3,3,3, 2,2,2, 1,1,1))

[Package bio3d version 1.0-5 Index]