inside.gpc.poly {surveillance} | R Documentation |
"gpc.poly"
Polygon
Same as, e.g., inside.owin
from package spatstat
and point.in.polygon
from package sp,
i.e., test whether points lie inside or outside a given polygon.
Actually, the method for "gpc.poly"
documented here internally uses
the point.in.polygon
function.
inside.gpc.poly(x, y = NULL, polyregion, mode.checked = FALSE)
x,y |
numeric vectors of coordinates of the points to be tested.
The coordinates can be supplied in any form accepted by
|
polyregion |
an object of class |
mode.checked |
passed to |
The nodes and edges of (non-hole) polygons are treated as being inside. Points that fall strictly inside holes are treated as being outside of the polygon.
Logical vector whose i
th entry is TRUE
if the corresponding
point (x[i],y[i])
is inside polyregion
.
Sebastian Meyer
if (requireNamespace("rgeos")) { poly <- discpoly(c(0.5,0.5), 0.5, npoly=4, class="gpc.poly") pts <- cbind(x=runif(50), y=runif(50)) plot(poly) points(pts, col=1+inside.gpc.poly(pts, polyregion=poly)) }