# multitype point pattern, broken down by type
by(amacrine, FUN=minnndist)
by(amacrine, FUN=function(x) { intensity(unmark(x)) })
if(require(spatstat.explore)) {
# how to pass additional arguments to FUN
by(amacrine, FUN=clarkevans, correction=c("Donnelly","cdf"))
}
# point pattern broken down by tessellation
data(swedishpines)
tes <- quadrats(swedishpines, 4,4)
## compute minimum nearest neighbour distance for points in each tile
B <- by(swedishpines, tes, minnndist)
if(require(spatstat.explore)) {
B <- by(swedishpines, tes, clarkevans, correction="Donnelly")
simplify2array(B)
}
Run the code above in your browser using DataLab