Here is my code:
train_points <- read.table(\"kaggle_train_points.txt\", sep=\"\\t\") train_labels <- read.table(\"kaggle_train_labels.txt\", sep=\"\\t
Simply set drop = TRUE while you're excluding cl from dataframe, it causes to remove dimension from an array which have only one level:
drop = TRUE
cl = train_labels[,1, drop = TRUE] knn(train_points, test_points, cl, k = 5)