使用 Stienen 集和膨胀将单例隔离成组

Isolate singletons in groups using Stienen sets and dilation

我想使用斯坦纳集 (spatstat::dilation) 形成点组。

有些单例需要删除,我正在考虑为此使用 Stienen 集 (spatstat::stienenSet):对于单例 Stienen > Steiner。

如何做到这一点?

library(spatstat)

a=stienenSet(redwood)
b=dilation(redwood, r=0.03)

plot(a, col='orange', main="")
plot(b,add=T, main="")

您可以使用 connected.ppp 来查找连通分量并识别 这样的单例(很抱歉快速未注释的代码):

library(spatstat)
## Points within distance R are connected.
## This should happen when two discs of radius r=0.03 touch each other,
## i.e., R=r+r=0.06:
cc <- connected(redwood, R=0.06)
s <- split(cc)
np <- sapply(s, npoints)
X <- s[np==1]
X <- unmark(superimpose(X))
Y <- s[np>1]
Y <- unmark(superimpose(Y))
plot(dilation(X, 0.03), main = "", col = "orange")
plot(dilation(Y, 0.03), add = TRUE)