data(oribatid)
ori.xy <- oribatid$xy[, c(2, 1)]
names(ori.xy) <- c("x","y")
plot(ori.xy,pch = 20, cex = 2, asp = 1)
if(requireNamespace("deldir", quiet = TRUE)) {
if(requireNamespace("spdep", quiet = TRUE)) {
plot(deldir(ori.xy), add = TRUE)
if(adegraphicsLoaded()) {
s.label(ori.xy, nb = knn2nb(knearneigh(as.matrix(ori.xy), 3)), plab.cex = 0)
} else {
s.label(ori.xy, add.p = TRUE, neig = nb2neig(knn2nb(knearneigh(as.matrix(ori.xy), 3))),
clab = 0)
}
}
}
Run the code above in your browser using DataLab