# NOT RUN {
## Generate data
X = aux.gensamples()
## 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
par(mfrow=c(1,3))
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")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab