[R-sig-Geo] group data into squares [map projection]

White.Denis at epamail.epa.gov White.Denis at epamail.epa.gov
Wed Nov 29 19:34:00 CET 2006


Luis Ridao Cruz <Luisr at frs.fo> wrote on 2006-11-29 03:40:25:

> R-sig-geo-help,
>
> I have locations of fish abundance
> which I want to aggregate into squares.
>
> 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?
>

One other point that could be made here has to do with counts in
non-equal area grids.  It appears that this is a latitude-longitude grid
over the Faroe Islands.  Because the grid covers a small extent in
latitude, the distortion in area for this grid is probably minimal,
however variation in cell size in such a grid does increase rapidly in
high latitudes.

If there is concern about this because of wanting the counts to
represent the same area of ocean, then the map projection facilities
available through package 'sp' would be the way to go.




More information about the R-sig-Geo mailing list