sp::over() for point in polygon analysis
问题 I have a shapefile named "ind_adm" and a SpatialPointsDataFrame called "pnts". The "pnts" contains points generated at random, and some of the points overlap with the polygon. See picture below. Now, I want do do a point in polygon analysis, i.e. I want to find out which points lie inside the gray polygon representing the boundary of India. For this I am using the over() function in the sp library. pt.in.poly <- sp::over(ind_adm, pnts, fn = mean) #do the join However, the output I am getting