I want to extract data of a
li which intersect with the
p R and then create a data frame with the coordinates and values of both objects. I tried
library(sf) out <- st_intersection(p, li)
I get the error
Error in UseMethod("st_intersection") :
no applicable method for 'st_intersection' applied to an object of class "c('SpatialPointsDataFrame', 'SpatialPoints', 'Spatial', 'SpatialVector')"
Not all points intersect with the polygon shape.
How could I extract the data of a polygon shape based on a point shape and then create a data frame of the result?