[R] Quadratcount problem in spatstat

Sebastian Schutte schutte at icr.gess.ethz.ch
Tue Dec 8 21:38:23 CET 2009


I know there are older threads discussing the quadratcount function in 
spatstat. Unfortunately, I could not find a solution to my problem there.

I'm analyzing a point pattern in an irregular polygonal window. Both the 
window (an entire country) and the points are projected using WGS84. 
When I do quadratcount with only one quadrat for the entire country it 
holds all my 154 points:

test <- quadratcount(ppp_cameroon, nx=1, ny=1)
[1] 154

But when I split the country up into several quadrats (which is the only 
thing that makes sense for the statistics), the function returns results 
that are plainly wrong. The counts always add up to 154, but when 
overlaid with the actual points it looks like some points are not at all 
counted (0 count quadrats where points are) and some count values are 
much higher than they should be (empty quadrats with 20 points).

The problem does not occur with the humberside example data. I can also 
reproduce everything in example(quadratcount) correctly with humberside, 
but not with my own data set.

Quadrat.test and quadrat.test.ppp lead to the same problem.

I'm out of ideas, so thank you very much for any suggestions!

I'm running R 2.10.0 under Ubuntu Linux 9.10 with spatstat 1.17-2

More information about the R-help mailing list