R: How can I count how many points are in each cell of my grid?
问题 I have made a reference grid, cells 50x50m, based on GPS locations of a collared animal. I want to do the equivalent to a spatial join in ArcGIS, and count the number of points in each cell. I have made a reference grid, using a SpatialPointsDataFrame object (the data frame is already projected, using UTM coordinate system) RESO <- 50 # grid resolution (m) BUFF <- 500 # grid extent (m) (buffer around location extremes) XMIN <- RESO*(round(((min(dat.spdf$Longitude)-BUFF)/RESO),0)) YMIN <- RESO