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

pairdist.ppx

Pairwise Distances in Any Dimensions


Description

Computes the matrix of distances between all pairs of points in a multi-dimensional point pattern.

Usage

## S3 method for class 'ppx'
pairdist(X, ...)

Arguments

X

A point pattern (object of class "ppx").

...

Arguments passed to coords.ppx to determine which coordinates should be used.

Details

This is a method for the generic function pairdist.

Given a multi-dimensional point pattern X (an object of class "ppx"), this function computes the Euclidean distances between all pairs of points in X, and returns the matrix of distances.

By default, both spatial and temporal coordinates are extracted. To obtain the spatial distance between points in a space-time point pattern, set temporal=FALSE.

Value

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

Author(s)

See Also

Examples

df <- data.frame(x=runif(4),y=runif(4),z=runif(4),w=runif(4))
   X <- ppx(data=df)
   pairdist(X)

spatstat.geom

Geometrical Functionality of the 'spatstat' Family

v2.1-0
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Tilman Davies [ctb], Ute Hahn [ctb], Abdollah Jalilian [ctb], Sebastian Meyer [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Waagepetersen [ctb]
Initial release
2021-04-15

We don't support your browser anymore

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