My goal is using the over() function in sp to determine which in which polygon a point exists. I have this error ( Error: unexpected '>' in ">" ) on using:
over(ptsUTM, hex_grid)
where class( ptsUTM ) = "SpatialPoints" and class( hex_grid ) = "SpatialPolygons". Both have the same @proj4string =
CRS arguments: +proj=utm +zone=14 +datum=WGS84 +units=km +no_defs +ellps=WGS84
The ptsUTM variable was created following the material in rDGAL, Tiff Files, and WorldFile, with these additions:
rr2[rr2<minDbzValue] <- NA
pol <- rasterToPolygons(rr2, fun=function(x){ x >= minDbzValue } )
pol2 = spTransform( pol, "+proj=utm +zone=14 +datum=WGS84 +units=km" )
ptsUTM = SpatialPoints( pol2 )
ptsUTM = hex_grid@proj4string
and hex_grid was created following the material at Fishnets and Honeycomb: Square vs. Hexagonal Spatial Grids