data(simdat)
quadrat.test(simdat)
quadrat.test(simdat, 4, 3)
# quadrat counts
qS <- quadratcount(simdat, 4, 3)
quadrat.test(qS)
# fitted model: inhomogeneous Poisson
fitx <- ppm(simdat, ~x, Poisson())
quadrat.test(fitx)
te <- quadrat.test(simdat, 4)
residuals(te) # Pearson residuals
plot(te)
plot(simdat, pch="+", cols="green", lwd=2)
plot(te, add=TRUE, col="red", cex=1.4, lty=2, lwd=3)
sublab <- eval(substitute(expression(p[chi^2]==z),
list(z=signif(te$p.value,3))))
title(sub=sublab, cex.sub=3)
# quadrats of irregular shape
B <- dirichlet(runifpoint(6, simdat$window))
qB <- quadrat.test(simdat, tess=B)
plot(simdat, main="quadrat.test(simdat, tess=B)", pch="+")
plot(qB, add=TRUE, col="red", lwd=2, cex=1.2)
Run the code above in your browser using DataLab