Subset spatial points with a polygon
问题 I have a SpatialPolygonsDataFrame (spolydf) and a SpatialPointsDataFrame (spointdf). The layers have different extents, but overlap. I can select points that fall within the polygon using fall.within.poly <- spointdf[spolydf,] How do I select points that fall outside the polygon? have tried fall.outside.poly <- spointdf[-spolydf,] but doesn't work. I'm mmissing something simple - any help please. 回答1: It's a bit late but I had the same issue today so I though that I would post my solution