Skip to content
Prev 2920 / 29559 Next

Define bordres in geoR using a shape file??

On Wed, 12 Dec 2007, Luca Moiana wrote:

            
Please quote a short extract of your commands, and show what sessionInfo() 
says, both help. My reading of the code suggests that if the class of your 
polygons object is "SpatialPolygons", you can pass this through borders=, 
and the internal point-in-polygon function will find which locations= 
points fall inside the polygons. The borders= argument can also be a 
matrix, but it is turned into a SpatialPolygons object internally. Use 
as(<>, "SpatialPolygons") to coerce to SpatialPolygons.

An alternative is to overlay() your input locations (SpatialGrid object) 
with the SpatialPolygons object to make a SpatialPixels object, then take 
coordinates() of that object and pass them through locations=.

Roger