[R-sig-Geo] quadracount on multitype points

Rolf Turner r.turner at auckland.ac.nz
Tue Sep 12 23:45:11 CEST 2017


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



More information about the R-sig-Geo mailing list