Thanks for all the suggestions. They were all very helpful. The "relrisk" 
function turned out to be even better than what I was trying to do. 

And Ege, no worries about self promotion. I already have a copy of the "spatial 
point pattern " book. 

Sincerely,

Guy

-----Original Message-----
From: Ege Rubak [mailto:ru...@math.aau.dk] 
Sent: September 13, 2017 2:21 AM
To: Guy Bayegnak <guy.bayeg...@gov.ab.ca>
Cc: Rolf Turner <r.tur...@auckland.ac.nz>; r-sig-geo@r-project.org; 
adrian.badde...@curtin.edu.au
Subject: Re: [R-sig-Geo] quadracount on multitype points

Hi Guy,

Maybe your explorative analysis could also benefit from `relrisk` in case you 
don't know that function?

It basically gives you a list of smooth images (one for each type) of the 
probability that a hypothetical sample at that location is of a given type. 
E.g. for the built-in multitype point pattern dataset `lansing` you would do:

     library(spatstat)
     prob <- relrisk(lansing, diggle=TRUE)
     plot(prob)

This example and more (e.g. a division of the sampling area into subsets of 
dominant types) can be found in Chapter 14 of our "spatstat book" if you need 
more details (sorry about the shameless self promotion, but I don't know a 
better source for this :-)).

Kind regards,
Ege

On 09/13/2017 01:08 AM, 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 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.
> 
> Sincerely,
> 
> Guy
> 
> -----Original Message-----
> From: Rolf Turner [mailto:r.tur...@auckland.ac.nz]
> Sent: September 12, 2017 3:45 PM
> To: Guy Bayegnak <guy.bayeg...@gov.ab.ca>
> Cc: r-sig-geo@r-project.org; adrian.badde...@curtin.edu.au; Ege Rubak 
> <ru...@math.aau.dk>
> Subject: Re: [R-sig-Geo] quadracount on multitype points
> 
> 
> On 13/09/17 02:11, Guy Bayegnak wrote:
> 
>> Dear all,
>>
>> I am working on a multitype point pattern, and I'd like to estimate 
>> how many of each type of point occurs into each quadrant. I know it 
>> is possible to use the quandracount on split marks as follows using
>> spatstats: quadratcount(split(marks)). But the result produces as 
>> many windows as they are marks. I am wondering is there is a way to 
>> know many occurrence of each type there is per quadrant and to plot 
>> it in a single grid.
>>
>> Thanks.
> 
> You really should start by mentioning that you are dealing with the spatstat 
> package.
> 
> It's not clear to me what you are after.  A minimal reproducible example 
> would be helpful.  I presume that by "quadrant" you mean one of the four 
> equal sub-windows formed by bisecting your (rectangular) window vertically 
> and horizontally.
> 
> If my presumption is correct then perhaps
> 
>       lapply(split(X),quadratcount,nx=2)
> 
> (where "X" is your point pattern) does what you want.  E.g.:
> 
>> lapply(split(amacrine),quadratcount,nx=2)
>> $off
>>           x
>> y         [0,0.801) [0.801,1.6]
>>    [0.5,1]        36          36
>>    [0,0.5)        34          36
>>
>> $on
>>           x
>> y         [0,0.801) [0.801,1.6]
>>    [0.5,1]        35          39
>>    [0,0.5)        42          36
> 
> Is this something like what you wish to achieve?
> 
> cheers,
> 
> Rolf Turner
> 
> --
> Technical Editor ANZJS
> Department of Statistics
> University of Auckland
> Phone: +64-9-373-7599 ext. 88276
> This email and any files transmitted with it are confidential and intended 
> solely for the use of the individual or entity to whom they are addressed. If 
> you have received this email in error please notify the system manager. This 
> message contains confidential information and is intended only for the 
> individual named. If you are not the named addressee you should not 
> disseminate, distribute or copy this e-mail.
> 
_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to