.\" -*- nroff -*- generated from .Rd format
.BG
.FN polygrid
.TL
Points inside a polygon
.DN
This function builds a rectangular grid and extracts points which are
inside of a polygonal region.
.CS

polygrid(xgrid, ygrid, poly, vec.inout = FALSE)

.RA
.AG xgrid
grid values at the X-direction.  
.AG ygrid
grid values at the Y-direction.  
.AG poly
a matrix with the coordinates of the polygon.  
.AG vec.inout
logical. If `TRUE' a logical vector is returned
indicating whether each point of the grid is inside the polygon.  
.RT
A list with components:
.AG xypoly
coordinates of the points inside the polygon.  
.AG vec.inout
a logical vector indicating whether each point of the grid is inside the polygon.
.SH REFERENCES
Further information about `geoR/geoS' can be found at:
.br
<URL: http://www.maths.lancs.ac.uk/~ribeiro/geoR.html>
.SA
`expand.grid', `inout'.
.EX
poly <- matrix(c(\&.2, .8, .7, .1, .2, .1, .2, .7, .7, .1), ncol=2)
plot(0:1, 0:1, type="n")
lines(poly)
poly.in <- polygrid(seq(0,1,l=11), seq(0,1,l=11), poly, vec=T)
points(poly.in$xy)
.KW spatial
.WR
