pairdist: Pairwise distances

View source: R/distances.R

pairdistR Documentation

Pairwise distances

Description

Computes the matrix of distances between all pairs of ‘things’ in a dataset

Usage

  pairdist(X, ...)

Arguments

X

Object specifying the locations of a set of ‘things’ (such as a set of points or a set of line segments).

...

Further arguments depending on the method.

Details

Given a dataset X and Y (representing either a point pattern or a line segment pattern) pairdist computes the distance between each pair of ‘things’ in the dataset, and returns a matrix containing these distances.

The function pairdist is generic, with methods for point patterns (objects of class "ppp"), line segment patterns (objects of class "psp") and a default method. See the documentation for pairdist.ppp, pairdist.psp or pairdist.default for details.

Value

A square matrix whose [i,j] entry is the distance between the ‘things’ numbered i and j.

Distance values

The values returned by pairdist(X) are distances, expressed as multiples of the unit of length of the spatial coordinates in X. The unit of length is given by unitname(X).

Note that, if the unit of length in X is a composite expression such as ‘2 microns’, then the values of pairdist(X) are expressed as multiples of 2 microns, rather than being expressed in microns.

Author(s)

\pavel

and \adrian.

See Also

pairdist.ppp, pairdist.psp, pairdist.default, crossdist, nndist, Kest


spatstat.geom documentation built on April 3, 2025, 7:41 p.m.