nndistsph: Nearest Neighbour Distances

View source: R/nndistsph.R

nndistsphR Documentation

Nearest Neighbour Distances

Description

Computes the distance from each point to its nearest neighbour in a point pattern on (a subset of) a sphere.

Usage

nndistsph(X, rad=1)

Arguments

X

Locations of points. An object of class sp2 or sp3, a 2 column matrix, with locations in spherical coordinates, or a 3 column matrix, with locations in Cartesian coordinates.

rad

Optional. The radius of the sphere, default value 1. Not required if X is an object of class sp2 or sp3.

Details

This function computes the minimum great circle distance from each point in a point pattern on a (subset of) a sphere to its nearest neighbour (the nearest other point of the pattern).

To use the nearest neighbour distances for statistical inference, it is often advisable to use the edge-corrected empirical distribution, computed by Gsphere.

To find the nearest neighbour distances from one point pattern to another point pattern, use nncrosssph.

If X is an object of class sp2 or sp3, then its radius will be used rather than that specified in rad.

Value

Numeric vector or matrix containing the nearest neighbour distances for each point.

Note

This function is the analogue for point processes on the sphere of the function nndist in spatstat, which is the corresponding function for point processes in R^2. Hence elements of this help page have been taken from nndist with the permission of A. J. Baddeley. This enables the information on this help page to be consistent with that for nndist. It is hoped that this will minimise or remove any confusion for users of both spatstat and spherstat .

Author(s)

Tom Lawrence <email: tjlawrence@bigpond.com>

See Also

pairdistsph (pairwise distances for a single sample), gcdist (great circle distance between two points), bdist.sphwin(boundary distances), nndist

Examples

sph <- sphwin(type="sphere")
rps <- rpoispp.sphwin(win=sph, lambda=1)
nndistsph(X=rps)

baddstats/spherstat documentation built on Feb. 6, 2023, 1:45 a.m.