Running examples in 'spatstat.core-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: quadrat.test
> ### Title: Dispersion Test for Spatial Point Pattern Based on Quadrat
> ###   Counts
> ### Aliases: quadrat.test quadrat.test.ppp quadrat.test.ppm
> ###   quadrat.test.slrm quadrat.test.quadratcount
> ### Keywords: spatial htest
> 
> ### ** Examples
> 
>   quadrat.test(simdat)

	Chi-squared test of CSR using quadrat counts

data:  simdat
X2 = 32.822, df = 24, p-value = 0.2158
alternative hypothesis: two.sided

Quadrats: 5 by 5 grid of tiles
>   quadrat.test(simdat, 4, 3)

	Chi-squared test of CSR using quadrat counts

data:  simdat
X2 = 15.65, df = 11, p-value = 0.3093
alternative hypothesis: two.sided

Quadrats: 4 by 3 grid of tiles
> 
>   quadrat.test(simdat, alternative="regular")

	Chi-squared test of CSR using quadrat counts

data:  simdat
X2 = 32.822, df = 24, p-value = 0.8921
alternative hypothesis: regular

Quadrats: 5 by 5 grid of tiles
>   quadrat.test(simdat, alternative="clustered")

	Chi-squared test of CSR using quadrat counts

data:  simdat
X2 = 32.822, df = 24, p-value = 0.1079
alternative hypothesis: clustered

Quadrats: 5 by 5 grid of tiles
> 
>   ## Likelihood ratio test
>   quadrat.test(simdat, CR=0)

	Likelihood ratio test of CSR using quadrat counts
	Test statistic: likelihood ratio test statistic G2
	(p-value obtained from chi-squared distribution)

data:  simdat
G2 = 37.144, df = 24, p-value = 0.08467
alternative hypothesis: two.sided

Quadrats: 5 by 5 grid of tiles
>   ## Power divergence tests
>   quadrat.test(simdat, CR=-1)$p.value
[1] 0.007573415
>   quadrat.test(simdat, CR=-2)$p.value
[1] 1.571774e-05
> 
>   # Using Monte Carlo p-values
>   quadrat.test(swedishpines) # Get warning, small expected values.
Warning: Some expected counts are small; chi^2 approximation may be inaccurate

	Chi-squared test of CSR using quadrat counts

data:  swedishpines
X2 = 18.085, df = 24, p-value = 0.4022
alternative hypothesis: two.sided

Quadrats: 5 by 5 grid of tiles
>   # quadrat.test(swedishpines, method="M", nsim=4999)
>   #  quadrat.test(swedishpines, method="M", nsim=4999, conditional=FALSE)
> 
>   ## Don't show: 
>     quadrat.test(swedishpines, method="M", nsim=19)

	Conditional Monte Carlo test of CSR using quadrat counts
	Test statistic: Pearson X2 statistic

data:  swedishpines
X2 = 18.085, p-value = 0.8
alternative hypothesis: two.sided

Quadrats: 5 by 5 grid of tiles
>     quadrat.test(swedishpines, method="M", nsim=19, conditional=FALSE)

	Unconditional Monte Carlo test of CSR using quadrat counts
	Test statistic: Pearson X2 statistic

data:  swedishpines
X2 = 18.085, p-value = 0.6
alternative hypothesis: two.sided

Quadrats: 5 by 5 grid of tiles
>   
> ## End(Don't show)
> 
>   # quadrat counts
>   qS <- quadratcount(simdat, 4, 3)
>   quadrat.test(qS)

	Chi-squared test of CSR using quadrat counts

data:  
X2 = 15.65, df = 11, p-value = 0.3093
alternative hypothesis: two.sided

Quadrats: 4 by 3 grid of tiles
> 
>   # fitted model: inhomogeneous Poisson
>   fitx <- ppm(simdat ~ x)
>   quadrat.test(fitx)

	Chi-squared test of fitted Poisson model 'fitx' using quadrat counts

data:  data from fitx
X2 = 32.584, df = 23, p-value = 0.1772
alternative hypothesis: two.sided

Quadrats: 5 by 5 grid of tiles
> 
>   # an equivalent test (results differ due to discretisation effects):
>   quadrat.test(simdat, lambda=predict(fitx), df.est=length(coef(fitx)))

	Chi-squared test of Poisson process with given intensity using quadrat
	counts

data:  simdat
X2 = 30.075, df = 23, p-value = 0.2945
alternative hypothesis: two.sided

Quadrats: 5 by 5 grid of tiles
> 
>   te <- quadrat.test(simdat, 4)
>   residuals(te)  # Pearson residuals
 [1]  0.76590579  0.76590579  0.76590579 -1.22901161 -1.22901161  1.90585859
 [7]  1.33588219 -0.65903521 -1.22901161 -0.37404701 -0.08905881 -1.22901161
[13] -1.22901161  0.76590579  1.33588219 -0.37404701
> 
>   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, Window(simdat)))
>   qB <- quadrat.test(simdat, tess=B)
Error in cut.ppp(X, tess) : length(z) == npoints(x) is not TRUE
Calls: quadrat.test ... quadratcount -> quadratcount.ppp -> cut -> cut.ppp -> stopifnot
Execution halted