[R] looping through spatial points and getting counts of spatial points in spatial grid in R

Roger Bivand Roger.bivand at nhh.no
Tue Dec 18 13:25:03 CET 2012


Tilottama Ghosh <waggymaggy <at> yahoo.com> writes:

> 
> Hi,
> Following Anthony's reply I am attaching two of the POI shapefiles and the
code for creating the spatial
> grid. I am not being able to read the list of these shapefiles and then
perform the points in spatial grid
> function. If someone can help, I will be very grateful.
> Here is my code for creating the spatial grid -Gridtopo_LS =
GridTopology(cellcentre.offset =

Please repost your question on the R-sig-geo list, and do follow the posting
guide. You should place any files on a web-server, not attach them, and make
sure that you do not post HTML messages, only plain text, so that the formatting
of your sample code is not disturbed.

Roger

> # Getting a count of the Spatial Points in the Spatial Data Frame in.cell <-
> overlay(SpatialGrid_LS,FinInstq2) newdata <-
data.frame(table(in.cell))View(newdata)
> "SpatialGrid_LS" is the spatial grid that I had created in R. 
> I guess a For loop would help, but although I tried several things, I haven't
been successful yet.
> Thanks!
> Tilo
> 
>




More information about the R-help mailing list