library(animation) ## an interactive demo: choose the test set by mouse-clicking if (interactive()) { ani.options(nmax = 5, interval=3) knn.ani(interact = TRUE, k=5) }