Skip to content
Prev 23620 / 29559 Next

Help with as.numeric(rownames(over(SpatialPoints(set1, set2, returnList= TRUE)[[1]]))

Hello.

Below is a fully repeatable R-Script that I'm having trouble with.
Generally, here's what I'm trying to do:

1) Randomly generate a tile.list()
2) Randomly generate a new point
3) Identify which polygon in the tile.list the new randomly generated point
is in

This works fine MOST of the time. However, occasionally, I get an error
returned:

Error in `[<-.data.frame`(`*tmp*`, list, 3, value = numeric(0)) :
While troubleshooting, I realized I get numeric(0) returned for certain
sets of new random points when I run the command
as.numeric(rownames(over(SpatialPoints(walker[i,1:2]),vpl,returnList=
TRUE)[[1]])). I thought maybe this was a boundary issue, but the points
don't lie on the edge, nor are they the centroid.

Any help you can provide would be greatly appreciated!

Regards,

Alan

R-Script Below:

### Help Question for  r-sig-geo ###