data(simdat)
X <- simdat
# Envelope of K function under CSR
plot(envelope(X))
<testonly>plot(envelope(X, nsim=4))</testonly>
# Translation edge correction (this is also FASTER):
plot(envelope(X, correction="translate"))
<testonly>plot(envelope(X, nsim=4, correction="translate"))</testonly>
# Envelope of K function for simulations from model
data(cells)
fit <- ppm(cells, ~1, Strauss(0.05))
plot(envelope(fit))
<testonly>plot(envelope(fit, nsim=4))</testonly>
# Envelope of G function under CSR
plot(envelope(X, Gest))
<testonly>plot(envelope(X, Gest, nsim=4))</testonly>
# Envelope of L function under CSR
# L(r) = sqrt(K(r)/pi)
E <- envelope(X, Kest)
plot(E, sqrt(./pi) ~ r)
<testonly>E <- envelope(X, Kest, nsim=4)
plot(E, sqrt(./pi) ~ r)</testonly>
# Simultaneous critical envelope for L function
# (alternatively, use Lest)
plot(envelope(X, Kest, transform=expression(sqrt(./pi)), global=TRUE))
<testonly>plot(envelope(X, Kest, nsim=4,transform=expression(sqrt(./pi)), global=TRUE))</testonly>
# How to pass arguments needed to compute the summary functions:
# We want envelopes for Jcross(X, "A", "B")
# where "A" and "B" are types of points in the dataset 'demopat'
data(demopat)
plot(envelope(demopat, Jcross, i="A", j="B"))
<testonly>plot(envelope(demopat, Jcross, i="A", j="B", nsim=4))</testonly>
# Use of `simulate'
plot(envelope(cells, Gest, simulate=expression(runifpoint(42))))
plot(envelope(cells, Gest, simulate=expression(rMaternI(100,0.02))))
<testonly>plot(envelope(cells, Gest, simulate=expression(runifpoint(42)), nsim=4))
plot(envelope(cells, Gest, simulate=expression(rMaternI(100, 0.02)), nsim=4))</testonly>
# Envelope under random toroidal shifts
data(amacrine)
plot(envelope(amacrine, Kcross, i="on", j="off",
simulate=expression(rshift(amacrine, radius=0.25))))
# Envelope under random shifts with erosion
plot(envelope(amacrine, Kcross, i="on", j="off",
simulate=expression(rshift(amacrine, radius=0.1, edge="erode"))))
# Envelope of INHOMOGENEOUS K-function with fitted trend
trend <- density.ppp(X, 1.5)
plot(envelope(X, Kinhom, lambda=trend,
simulate=expression(rpoispp(trend))))
Run the code above in your browser using DataLab