[R-sig-Geo] group data into squares

Clément Calenge calenge at biomserv.univ-lyon1.fr
Wed Nov 29 13:07:59 CET 2006


Dear Luis,

> The code below creates the grid:
>
>
> library(sp)
> test <- GridTopology(c(-10.5,60),c(0.1,0.1),c(67,35))
> coordinates(test)
> coordinatevalues(test)
> yy <-SpatialGrid(grid=test)
> plot(yy,pch=16,cex=0.3,col=1)
>
> and within each cell the total abundance of fish
> should be specified.
>
> How can I do this?
>   
You can try the functions ascgen() and/or count.points() from the 
package adehabitat. Then, use the function asc2spixdf to convert the 
result to the class SpatialGridDataFrame.
Hope this helps,


Clément Calenge

-- 
Clément CALENGE
LBBE - UMR CNRS 5558 - Université Claude Bernard Lyon 1 - FRANCE
tel. (+33) 04.72.43.27.57
fax. (+33) 04.72.43.13.88




More information about the R-sig-Geo mailing list