splitcaps: Extract Points Falling in a Given Cap

View source: R/splitcaps.R

splitcapsR Documentation

Extract Points Falling in a Given Cap

Description

Extract all the points in a band (two disjoint parallel caps) that fall in a specified cap.

Usage

splitcaps(X, win=sphwin(type="sphere"), upper=TRUE, lower=TRUE, as.sp=TRUE)

Arguments

X

The point pattern. An object of class sp2 or sp3, or matrix.

win

The window that contains the point pattern, must be an object of class sphwin with type=="bandcomp". Only used if X is an object of class matrix.

upper,lower

Logicals, denoting whether the output should contain the points in the upper and lower caps respectively.

as.sp

Optional. If TRUE, and X is an object of class sp2 or sp3, the output will be the an object or list of objects the same class as X.

Details

A complement of a band is the union of two disjoint caps with parallel bases. This code separates the points in such a window by the cap that they are in. In this context the upper cap is the cap with base defined by the first entry in the argument param in the sphwin object that defines the window, the lower cap with base defined by the second argument.

Value

If upper=TRUE and lower=FALSE a matrix containing the locations of the points in the upper cap (if also as.sp=FALSE) or an object of the same class as X.

If upper=FALSE and lower=TRUE a matrix containing the locations of the points in the lower cap (if also as.sp=FALSE) or an object of the same class as X.

If upper=TRUE and lower=TRUE a list containing two objects, which are those described in the two previous cases (i.e. the first object contains the points in the upper cap, the second object contains the points in the lower cap — as matrices (if as.sp=FALSE), or as objects of the same class as X).

Author(s)

Tom Lawrence <email:tjlawrence@bigpond.com>

See Also

gcdist

Examples

X <- rpoispp.sphwin(lambda=10, win=sphwin("bandcomp", param=c(pi/3, 2*pi/3)))
Xupper <- splitcaps(X=X, upper=TRUE, lower=FALSE)
Xlower <- splitcaps(X=X, upper=FALSE, lower=TRUE)
Xboth <- splitcaps(X=X, upper=TRUE, lower=TRUE)

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