Learn R Programming

lgcp (version 1.0)

getCounts: getCounts function...

Description

getCounts function

Usage

getCounts(xyt, subset=rep(TRUE, xyt$n), M, N, ext)

Arguments

xyt
stppp or ppp data object
subset
Logical vector. Subset of data of interest, by default this is all data.
M
number of centroids in x-direction
N
number of cnetroids in y-direction
ext
how far to extend the grid eg (M,N) to (ext*M,ext*N)

Value

  • The number of observations in each grid cell returned on a grid suitable for use in the extended FFT space.

Details

This function is used to count the number of observations falling inside grid cells, the output is used in the function lgcpPredict.

See Also

lgcpPredict

Examples

Run this code
xyt <- stppp(ppp(runif(100),runif(100)),t=1:100,tlim=c(1,100))
cts <- getCounts(xyt,M=64,N=64,ext=2) # gives an output grid of size 128 by 128
ctssub <- cts[1:64,1:64] # returns the cell counts in the observation
# window of interest}

Run the code above in your browser using DataLab