data(iris)
iris <- as.matrix(iris[,1:4]) ### only use numeric attributes
# use a shared neighborhood of 10 points and require 6 shared neighbors
cl <- jpclust(iris, k = 10, kt = 6)
pairs(iris, col = cl)
# use a precomputed kNN object instead of the original data.
nn <- kNN(iris, k = 15)
nn
cl <- jpclust(nn, k = 10, kt = 6)
Run the code above in your browser using DataLab