library(spatstat)
set.seed(123)
elevation <- bei.extra$elev
slope <- bei.extra$grad
plot(elevation)
plot(slope)
# use only part of the point pattern for this example
Xun <- rthin(bei,0.05)
# use elevation values as marks
X <- Xun %mark% elevation[Xun]
# use terrain gradient as covariate
covariate <- slope
# tests run with only 99 shifts to speed up the computation
out1 <- PMC.test(X=X, covariate=covariate, N.shifts = 99, radius=250, correction="torus",
type="Kendall", verbose=TRUE)
out1
out2 <- PMC.test(X=X, covariate=covariate, N.shifts = 99, radius=250, correction="variance",
type="Kendall", verbose=TRUE)
out2
Run the code above in your browser using DataLab