# NOT RUN {
x <- matrix(c(0, 0,
1, 0,
2, 1,
0, 4,
1, 3),
ncol = 2, byrow = TRUE)
d <- dist(x, diag = TRUE, upper = TRUE)
dist_to_knn(d, k = 3)
# }
Run the code above in your browser using DataLab