.nncross {groupedHyperframe}R Documentation

Alternative Interface of nncross.ppp

Description

An alternative interface of function nncross.ppp.

Usage

.nncross(X, i, j, ...)

Arguments

X

see Details

i, j

character or integer scalars. See functions Gcross, etc. for more details

...

additional parameters of nncross.ppp

Details

Function .nncross() creates an interface similar to functions Gcross, etc., which takes an is.multitype ppp.object and two mark values i and j, then calls the workhorse function nncross.ppp with parameter what = 'dist'. If mark values i and j does not exist in the ppp.object, a NULL value will be returned.

Value

Function .nncross() returns a numeric vector if i and j are valid mark values of ppp.object X; otherwise returns a NULL value.

Examples

library(spatstat.data)
library(spatstat.geom)

(xs = split.ppp(amacrine))
(a1 = nncross(X = xs$off, Y = xs$on, what = 'dist'))
a2 = .nncross(amacrine, i = 'off', j = 'on')
a3 = .nncross(amacrine, i = 1L, j = 2L)
stopifnot(identical(a1, a2), identical(a1, a3))

.nncross(amacrine, i = 'a', j = 'b') # exception handling

[Package groupedHyperframe version 0.2.1 Index]