data(simdat)
quadrat.test(simdat)
quadrat.test(simdat, 4, 3)
quadrat.test(simdat, alternative="regular")
quadrat.test(simdat, alternative="clustered")
# Using Monte Carlo p-values
quadrat.test(swedishpines) # Get warning, small expected values.
quadrat.test(swedishpines, method="M", nsim=4999)
quadrat.test(swedishpines, method="M", nsim=4999, conditional=FALSE)
<testonly>quadrat.test(swedishpines, method="M", nsim=19)
quadrat.test(swedishpines, method="M", nsim=19, conditional=FALSE)</testonly>
# 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