## Compare with fig. 5b of Getis & Franklin (1987: 476):
data(ponderosa)
#ponderosa12 <- getis(ponderosa, nx = 30, ny = 30, R = 12)
ponderosa12 <- getis(ponderosa, nx = 20, ny = 20, R = 12)
plot(ponderosa12, type = "l", dimyx=256)
if (FALSE) {
## Plot the same, using Smooth.ppp in spatstat
ponderosa.12 <- setmarks(ponderosa, ponderosa12$klocal)
Z <- Smooth(ponderosa.12, sigma=5, dimyx=256)
plot(Z, col=topo.colors(128), main="smoothed neighbourhood density")
contour(Z, add=TRUE)
points(ponderosa, pch=16, cex=0.5)
## Example with irregular window:
data(letterR)
X <- rpoispp(50, win=letterR)
X.g <- getis(X, R=0.2)
plot(X.g,dimyx=c(200,100))
## Plot the same, using Smooth.ppp in spatstat
X2 <- setmarks(X, X.g$klocal)
Z <- Smooth(X2, sigma=0.05, dimxy=256)
plot(Z, col=topo.colors(128), main="smoothed neighbourhood density")
contour(Z, add=TRUE)
points(X, pch=16, cex=0.5)
}
Run the code above in your browser using DataLab