
(1) Why the pixellation?  Because you haven't set 
spatstat.options(gpclib=TRUE).
Hence when quadrat.test() divides your polygonal window up into 4 quadrats,
it converts that window to a mask.

(2) The warning in str(M):  This has absolutely nothing to do with 
quadrat.test.
It's a feature of windows of type mask.  The warning is there as a 
reminder to
those users who are sufficiently foolhardy as to delve into the internal 
workings
of such windows.  The pixel values (TRUE and FALSE) are stored as a matrix,
and the correspondence of rows and columns of a matrix and x and y 
coordinates
is confusing and counterintuitive.  See fortune("conventions").

No ``fix'' is needed.

     cheers,

         Rolf Turner

On 18/05/11 05:21, Robin W Hunnewell wrote:
> Dear R-sig Geo people,
> I've run a quadrat.test on a "ppp" object, for which the obs. window 
> "owin" is a convex polygon:
>
> > summary(my.ppp)
> Planar point pattern: 660 points
> Average intensity 0.461 points per square kilometer
>
> Window: polygonal boundary
> single connected closed polygon with 41 vertices
> enclosing rectangle: [-7420.406, -7373.856]x[5451.656, 5506.241]kilometer
> Window area =  1432.66 square kilometer
> Unit of length: 1 kilometer
>
>
> After running the test,
> > M <- quadrat.test(my.ppp, nx= 2, ny= 2)
>
> and then printing / plotting M, an object of class "quadrattest" 
> "htest", the returned value is plotted as levels (colored tiles) of a 
> pixel image:
>
> > M
> Chi-squared test of CSR using quadrat counts
> data: my.ppp
> X-squared = 89.6415, df = 3, p-value < 2.2e-16
> Quadrats: 4 tiles (levels of a pixel image)
>
>
> why the pixellation?  From what I can gather, it has to do with the 
> row / column matrix indices of my "owin" -- when typing  str(M), 
> there's a warning in the digest referring to the window: "Transpose 
> matrices to get the standard presentation in R" "Example: 
> image(result$xcol,result$yrow,t(result$d))"
> Here is that section with the warning:
>
> >str(M)
>
>  .. ..$ window:List of 11
>   .. .. ..$ type    : chr "mask"
>   .. .. ..$ xrange  : num [1:2] -7420 -7374
>   .. .. ..$ yrange  : num [1:2] 5452 5506
>   .. .. ..$ dim     : int [1:2] 100 100
>   .. .. ..$ xstep   : num 0.465
>   .. .. ..$ ystep   : num 0.546
>   .. .. ..$ warnings: chr [1:3] "Row index corresponds to increasing y 
> coordinate; column to increasing x" "Transpose matrices to get the 
> standard presentation in R" "Example: 
> image(result$xcol,result$yrow,t(result$d))"
>   .. .. ..$ xcol    : num [1:100] -7420 -7420 -7419 -7419 -7418 ...
>   .. .. ..$ yrow    : num [1:100] 5452 5452 5453 5454 5454 ...
>   .. .. ..$ m       : logi [1:100, 1:100] FALSE FALSE FALSE FALSE 
> FALSE FALSE ...
>   .. .. ..$ units   :List of 3
>   .. .. .. ..$ singular  : chr "kilometer"
>   .. .. .. ..$ plural    : chr "kilometer"
>   .. .. . ..$ multiplier: num 1
>   .. .. .. ..- attr(*, "class")= chr "units"
>   .. .. ..- attr(*, "class")= chr "owin"
>
>
> I understand for "im" objects in {spatstat}, the correspondence 
> between matrix indices mat[i,j] and cartesian coordinates is: rows 
> correspond to the y coordinate, and the columns to the x coordinate.
>
> But guess I'm just not sure whether and if the row / column index for 
> my "owin" object needs to be transposed, or if this is something to 
> worry about at all.
> I'd created the "owin" by importing it from .shp file (readShapePoly) 
> and then used  as(W,"owin"). Is it a problem to do it that way?
> Thanks v much for any clarification, and how to 'fix' if necessary?
> Robin
>


	[[alternative HTML version deleted]]

