| inside.boxx {spatstat} | R Documentation |
Test whether points lie inside or outside a given multidimensional box.
inside.boxx(..., w)
... |
Coordinates of points to be tested.
One vector for each dimension (all of same length).
(Alternatively, a single point pattern object
of class |
w |
A window.
This should be an object of class |
This function tests whether each of the points
(x[i],y[i]) lies inside or outside
the window w and returns TRUE if it is inside.
The boundary of the window is treated as being inside.
Normally each argument provided (except w) must be numeric vectors of
equal length (length zero is allowed) containing the coordinates
of points.
Alternatively a single point pattern (object of class "ppx")
can be given; then the coordinates of the point pattern are extracted.
Logical vector whose ith entry is
TRUE if the corresponding point is inside w.
Adrian Baddeley Adrian.Baddeley@curtin.edu.au
Rolf Turner r.turner@auckland.ac.nz
and Ege Rubak rubak@math.aau.dk
# Random points in box with side [0,2] w <- boxx(c(0,2), c(0,2), c(0,2)) # Random points in box with side [-1,3] x <- runif(30, min=-1, max=3) y <- runif(30, min=-1, max=3) z <- runif(30, min=-1, max=3) # Points falling in smaller box ok <- inside.boxx(x, y, z, w=w) # Same using a point pattern as argument: X <- ppx(data = cbind(x, y, z), domain = boxx(c(0,3), c(0,3), c(0,3))) ok2 <- inside.boxx(X, w=w)