knn classifier working in R