group data into squares
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