[R-sig-Geo] convert point data to count data

Mathieu Basille basille at biomserv.univ-lyon1.fr
Thu Jun 11 08:11:33 CEST 2009


Hi Karla,

Appart from spatstat/sp, you might give a try to adehabitat: there's a 
function called 'ascgen' which does exactly what you want: create a grid 
of a given resolution according to the points you have, with the number 
of points in each cell. Check ?ascgen (and especially the example) for 
further details. There are eventually functions to convert maps from 
adehabitat to sp if needed.

Hope this helps,
Mathieu.


Karla Falk a écrit :
> Hi,
> 
>   I have a data set of points that I would like to convert to grid cell counts.  Ultimately I would like to end up with a table that has an x-y coordinate for each grid cell, and the count of the # of points falling in each grid cell.  Does anyone know a way to do this in R?  I have been playing around with using quadratcounts in spatstat, and the overlay methods in sp, but with both I can't figure out how to get an output table of the cell counts (including counts of zero's) with the corresponding x-y utm of the grid cell.  Any help would be greatly appreciated!
> 
> Thanks,
> Karla


-- 

mathieu at lbbe:~$ whoami
 > Mathieu Basille, PhD

mathieu at lbbe:~$ locate
 > Laboratoire de Biométrie et Biologie Évolutive
 > Université Claude Bernard Lyon 1 - France
 > http://lbbe.univ-lyon1.fr/

mathieu at lbbe:~$ info
 > http://ase-research.org/basille

mathieu at lbbe:~$ fortune
 > ``If you can't win by reason, go for volume.''
 > Calvin, by Bill Watterson.



More information about the R-sig-Geo mailing list