# \donttest{
## Generate data
set.seed(100)
X = aux.gensamples(n=100)
## Test three different types of neighborhood connectivity
nn1 = aux.graphnbd(X,type=c("knn",20)) # knn with k=20
nn2 = aux.graphnbd(X,type=c("enn",1)) # enn with radius = 1
nn3 = aux.graphnbd(X,type=c("proportion",0.4)) # connecting 40% of edges
## Visualize
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,3), pty="s")
image(nn1$mask); title("knn with k=20")
image(nn2$mask); title("enn with radius=1")
image(nn3$mask); title("proportion of ratio=0.4")
par(opar)
# }
Run the code above in your browser using DataLab