getCounts: getCounts function

Description Usage Arguments Value See Also Examples

Description

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

Usage

1
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.

See Also

lgcpPredict

Examples

1
2
3
4
5
require(spatstat)
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

bentaylor1/lgcp documentation built on May 12, 2019, 2:09 p.m.