XY=cbind(runif(80,min = -1,max = 1),rnorm(80))
#closed polygon
polymat <- cbind(x = c(0,1,1,0), y = c(0,0,1,1))
#takes sometimes more than 5 sec
# \donttest{
Cls=PointsInPolygon(XY,polymat,PlotIt = TRUE)
# }
Run the code above in your browser using DataLab