metric.object: Distance Metric

metric.objectR Documentation

Distance Metric

Description

An object of class "metric" defines a measure of distance between points, and supports many operations that involve distances.

Details

A ‘metric’ d is a measure of distance between points that satisfies

  1. d(x,x) = 0 for any point x,

  2. d(x,y) > 0 for any two distinct points x and y

  3. symmetry: d(x,y) = d(y,x) for any two points x and y

  4. triangle inequality: d(x,y) \le d(x,z) + d(z,y) for any three points x,y,z.

The Euclidean distance between points is an example of a metric.

An object of class "metric" is a structure that defines a metric and supports many computations that involve the metric. The internal structure of this object, and the mechanism for performing these computations, are under development.

Objects of class "metric" are produced by the function convexmetric and possibly by other functions.

There are methods for print and summary for the class "metric". The summary method lists the operations that are supported by the metric.

To perform distance calculations (for example, nearest-neighbour distances) using a desired metric instead of the Euclidean metric, first check whether the standard function for this purpose (for example nndist.ppp) has an argument named metric. If so, use the standard function and add the argument metric; if not, use the low-level function invoke.metric.

Author(s)

\spatstatAuthors

.

See Also

convexmetric, invoke.metric

Examples

  m <- convexmetric(square(c(-1,1)))
  summary(m)
  y <- nndist(cells, metric=m)

spatstat.geom documentation built on Sept. 18, 2024, 9:08 a.m.