"gpc.poly"
Polygoninside.owin
from package point.in.polygon
from package "gpc.poly"
documented here internally uses
the point.in.polygon
function.inside.gpc.poly(x, y = NULL, polyregion, mode.checked = FALSE)
xy.coords
."gpc.poly"
. It is checked if the points specified
through x
and y
fall into this polygonal region.point.in.polygon
.i
th entry is TRUE
if the corresponding
point (x[i],y[i])
is inside polyregion
.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))
}
Run the code above in your browser using DataLab