pairdist.psp: Pairwise distances between line segments

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/distances.psp.R

Description

Computes the matrix of distances between all pairs of line segments in a line segment pattern.

Usage

1
2
  ## S3 method for class 'psp'
pairdist(X, ..., method="C", type="Hausdorff")

Arguments

X

A line segment pattern (object of class "psp").

...

Ignored.

method

String specifying which method of calculation to use. Values are "C" and "interpreted". Usually not specified.

type

Type of distance to be computed. Options are "Hausdorff" and "separation". Partial matching is used.

Details

This function computes the distance between each pair of line segments in X, and returns the matrix of distances.

This is a method for the generic function pairdist for the class "psp".

The distances between line segments are measured in one of two ways:

The argument method is not normally used. It is retained only for checking the validity of the software. If method = "interpreted" then the distances are computed using interpreted R code only. If method="C" (the default) then compiled C code is used, which is somewhat faster.

Value

A square matrix whose [i,j] entry is the distance between the line segments numbered i and j.

Author(s)

\adrian

and \rolf

See Also

crossdist, nndist, pairdist.ppp

Examples

1
2
3
   L <- psp(runif(10), runif(10), runif(10), runif(10), owin())
   D <- pairdist(L)
   S <- pairdist(L, type="sep")

spatstat documentation built on May 30, 2017, 7:53 a.m.

Search within the spatstat package
Search all R packages, documentation and source code