title: Accessing dataframe column causes Error in sort.list(y) : 'x' must be atomic for 'sort.list'
body: <p>Currently I'm trying to use knnMCN()</p>
  
  <p>I'm doing it in this format...</p>
  
  <pre><code>knnMCN(data, classification, data2, K=1, ShowObs=T)
  </code></pre>
  
  <p>The files data, classification, and data2 are all .csv files. 'data' is my training data, 'classification' is a single column file of classifications (classified as 0, 1 or 2) and data2 is the dataset I want to classify.</p>
  
  <p>There are only numerical values in these files. Whenever I run this command I get the error: </p>
  
  <pre><code>Error in sort.list(y) : 'x' must be atomic for 'sort.list'
  Have you called 'sort' on a list?
  </code></pre>
  
  <p>Anybody know what is going wrong here? Is there a better/different way to do K-Nearest Neighbors?</p>
  
  <p>EDIT: These are the results of dput(head(data/classification/data2))</p>
  
  <p>data:</p>
  
  <pre><code>structure(list(down = c(1L, 2L, 3L, 1L, 2L, 1L), yards_to_first = c(10L, 
  7L, 7L, 10L, 7L, 10L), yards_to_endzone = c(84L, 81L, 81L, 73L, 
  70L, 40L), score_difference = c(0L, 0L, 0L, 0L, 0L, 0L), quarter = c(1L, 
  1L, 1L, 1L, 1L, 1L), seconds_remaining = c(3595L, 3560L, 3554L, 
  3523L, 3476L, 3450L)), .Names = c("down", "yards_to_first", "yards_to_endzone", 
  "score_difference", "quarter", "seconds_remaining"), row.names = c(NA, 
  6L), class = "data.frame")
  </code></pre>
  
  <p>classification:</p>
  
  <pre><code>structure(list(play_type = c(0L, 1L, 1L, 0L, 1L, 1L)), .Names = "play_type",
  row.names = c(NA,6L), class = "data.frame")
  </code></pre>
  
  <p>data2:</p>
  
  <pre><code>structure(list(down = c(1L, 2L, 3L, 4L, 1L, 2L), yards_to_first = c(10L, 
  5L, 8L, 8L, 10L, 10L), yards_to_endzone = c(58L, 53L, 56L, 56L, 
  98L, 98L), score_difference = c(0L, 0L, 0L, 0L, 0L, 0L), quarter = c(1L, 
  1L, 1L, 1L, 1L, 1L), seconds_remaining = c(3593L, 3556L, 3515L, 
  3507L, 3496L, 3460L)), .Names = c("down", "yards_to_first", "yards_to_endzone", 
  "score_difference", "quarter", "seconds_remaining"), row.names = c(NA, 
  6L), class = "data.frame")
  </code></pre>