title: Accessing column with df[col] gives: Error 'x' must be atomic for 'sort.list'
body: <p>I have a very simple array on which I want to run ROC curve analysis. But first, when i try to force data into Factor type using command <code>table[1]&lt;-factor(table[1])</code>, 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>Few sample rows from the data are give below</p>
  
  <pre><code>GRADE   TRUE-GRADE
  
  benign  Benign
  benign  Benign
  benign  Benign
  benign  Benign
  benign  Benign
  benign  Benign
  benign  Malignant
  benign  Malignant
  indeterminate   Benign
  indeterminate   Benign
  indeterminate   Benign
  indeterminate   Benign
  indeterminate   Benign
  indeterminate   Benign
  indeterminate   Benign
  indeterminate   Benign
  indeterminate   Benign
  indeterminate   Benign
  indeterminate   Benign
  indeterminate   Benign
  indeterminate   Benign
  indeterminate   Malignant
  indeterminate   Malignant
  indeterminate   Malignant
  likely benign   Benign
  likely benign   Benign
  likely benign   Benign
  </code></pre>
  
  <p>Can someone tell me what I am doing wrong ? result of str(table) is given below:</p>
  
  <pre><code>data.frame':   127 obs. of  2 variables:
   $ GRADE        : Factor w/ 5 levels "benign","indeterminate",..: 1 1 1 1 1 1 1 1 1 
  
   $ BENIGN.MALIGN: Factor w/ 2 levels "Benign","Malignant": 1 1 1 1 1 1 1 1 1 1 ...
  </code></pre>