[R-sig-Geo] quadracount on multitype points

Rolf Turner r.turner at auckland.ac.nz
Wed Sep 13 10:40:53 CEST 2017


On 13/09/17 11:08, Guy Bayegnak wrote:
> Thanks a lot for your response and suggestion Rolf.  Yes, by "quadrant" I mean the little sub-windows.  My problem is the following:
> 
> We have collected thousands of groundwater samples across a vast area, and analysed them. Based on the analysis we are able to assign a "type" to each water sample.  When plotted, there seems to be a spatial trend in water type. But a given area may have more than one water type,  usually with a dominant type (most frequently occurring). What I am trying to do is identify the dominant type for each sub-region /sub-windows but show the count side by side, for example:
> 
>            x
>   y         [0,0.801)            [0.801,1.6]
>    [0.5,1]   Off =     36                Off =  6
>             On =   3     On = 39
> 
>     [0,0.5)   Off =  4              Off = 36
>              On = 42        On = 6
> 

I don't understand the counts in the foregoing.  Have some digits been 
left off in places?  I.e. should this be:
 >
 >            x
 >   y         [0,0.801)            [0.801,1.6]
 >    [0.5,1]   Off = 36               Off = 36
 >              On  = 35               On  = 39
 >
 >     [0,0.5)  Off = 34               Off = 36
 >              On  = 42               On  = 36       ???
 >


> I think I can achieve what I am looking for with your suggestion. Once I get the table list, I will copy the numbers side by side manually.

Yeucch!  Manually?  Saints preserve us!

Do you really mean "quadrant" or do you simply mean *quadrat*???

Sticking with quad*rant* (it doesn't really matter), how about something 
like:

rants <- tiles(quadrats(Window(amacrine),nx=2))
lapply(rants,function(w,pat){table(marks(pat[w]))},pat=amacrine)

which gives:

> $`Tile row 1, col 1`
> 
> off  on 
>  36  35 
> 
> $`Tile row 1, col 2`
> 
> off  on 
>  36  39 
> 
> $`Tile row 2, col 1`
> 
> off  on 
>  34  42 
> 
> $`Tile row 2, col 2`
> 
> off  on 
>  36  36 

cheers,

Rolf

P. S.  But you are probably well-advised to forget all this quadrat 
counting stuff and use relrisk() as suggested by Ege Rubak.

R.

-- 
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276



More information about the R-sig-Geo mailing list