Determines which of a set of points lie inside a closed polygon or at least one of a set of polygons
2-column matrix or dataframe of x-y coordinates for points to assess
2-column matrix or dataframe containing perimeter points of polygon, or a SpatialPolygonsDataFrame object from package sp, or a ‘mask’ object (see Warning)
logical to control the output when ‘poly’ is a mask (see Details)
poly is a SpatialPolygonsDataFrame object then the method
over is used from sp. This allows multiple polygons and
polygons with holes.
poly is an secr ‘mask’ object then
xy is discretized
and matched to the cells in
logical = FALSE
then the returned value is a vector of integer indices to the row in
‘poly’ corresponding to each row of ‘xy’; otherwise the result is a
vector of logical values.
Otherwise, the algorithm is adapted from some code posted on the S-news list by Peter Perkins (23/7/1996). The polygon should be closed (last point same as first).
Vector of logical or integer values, one for each row in
poly is a mask object then its cells must be
aligned to the x- and y- axes
1 2 3 4 5 6
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.