Edzer, thanks for the info, any idea when the next CRAN release due?

And Roger, thanks for the work around.

Andrew.


On Mon, Apr 7, 2008 at 7:03 AM, Edzer Pebesma <[EMAIL PROTECTED]>
wrote:

> Andrew,
>
> this is a bug; thanks for the clear report.
>
> the code in cvs has it corrected, meaning that the next CRAN release
> should work.
>
> I also noted that fn is ignored for grids; it should work there too, so
> that the lengthy
>
> g.poly <- as(g, "SpatialPolygons")
>
> wouldn't be required. This still needs some work.
> --
> Edzer
>
>
> Andrew James Hoskins wrote:
>
> > Hi all,
> >
> > I'm trying to get the sum of value z for all points that fall within a
> > grid
> > square.  I've been trying to use the overlay function on a grid
> > converted to
> > polygons, however, it returns the sum of the coordinates and the z
> > values,
> > how can I have it return only the sum of z?
> > Also, once I have the sum of z how then can I assign that to it's
> > corresponding grid square?
> >
> > ## Example code
> >
> > g <- GridTopology(c(-10,-10), c(1,1), c(21,21))
> > g.poly <- as(g, "SpatialPolygons")
> >
> > x <- c(1:10,1:10)
> > y <- c(10:1,10:1)
> > z <- 1:20
> >
> > xyz <- SpatialPointsDataFrame(cbind(x,y),data.frame(z))
> >
> > ol <- overlay(xyz, g.poly, fn=sum)
> >
> >
> > Thanks in advance.
> >
> > Andrew.
> >
> >
> >
> >
> >
>
>


-- 
Andrew Hoskins
PhD Candidate
Deakin University, Australia
Email: [EMAIL PROTECTED]
Phone: +61 (3) 9251 7418

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to