inside.swin {ads} | R Documentation |
Function inside.swin
tests whether points lie inside or outside a given sampling window.
inside.swin(x, y, w, bdry=TRUE)
x |
a vector of x coordinates of points. |
y |
a vector of y coordinates of points. |
w |
an object of class "swin" (see swin ) defining the sampling window. |
bdry |
by default bdry = TRUE . If FALSE , points located
on the boundary of the sampling window are considered to be outside. |
A logical vector whose ith
entry is TRUE
if the corresponding point (x[i],y[i]) is inside w, FALSE
otherwise.
For "complex"
sampling windows, points inside the triangles to remove or on their boundary, are considered outside.
swin
.
data(BPoirier) BP<-BPoirier wr<-swin(BP$rect) sum(inside.swin(BP$trees$x,BP$trees$y,wr)) wc<-swin(c(55,45,45)) sum(inside.swin(BP$trees$x,BP$trees$y,wc)) wrt<-swin(BP$rect,triangles=BP$tri1) sum(inside.swin(BP$trees$x,BP$trees$y,wrt))