I am working with shapefiles in R, one is point.shp the other is a polygon.shp. Now, I would like to intersect the points with the polygon, meaning that all
You do this in one line with point.in.poly fom spatialEco package.
point.in.poly
spatialEco
library(spatialEco) new_shape <- point.in.poly(pts, polys)
from the documentation: point.in.poly "intersects point and polygon feature classes and adds polygon attributes to points".