title: KNN in R: 'train and class have different lengths'?
body: <p>Here is my code:</p>
  
  <pre><code>train_points &lt;- read.table("kaggle_train_points.txt", sep="\t")
  train_labels &lt;- read.table("kaggle_train_labels.txt", sep="\t")
  test_points &lt;- read.table("kaggle_test_points.txt", sep="\t")
  
  #uses package 'class'
  library(class)
  knn(train_points, test_points, train_labels, k = 5);
  </code></pre>
  
  <p><code>dim(train_points)</code> is 42000 x 784<br>
  <code>dim(train_labels)</code> is 42000 x 1</p>
  
  <p>I don't see the issue, but I'm getting the error :</p>
  
  <blockquote>
    <p>Error in knn(train_points, test_points, train_labels, k = 5) :<br>
    'train' and 'class' have different lengths.</p>
  </blockquote>
  
  <p>What's the problem?</p>