title: Convert a column in dataframe into a factor error
body: <p>I want to change the <em>Strategy</em> column into a factor variable, and used the following:</p>
  
  <pre><code>jan17dat[,"Strategy"] &lt;- as.factor(jan17dat[,"Strategy"])
  </code></pre>
  
  <p>but got this 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>Tried to order the column strategy as follows;</p>
  
  <pre><code>jan17dat&lt;-jan17dat[order(jan17dat$Strategy)]
  </code></pre>
  
  <p>But got this error.</p>
  
  <pre><code>Error: Column indexes must be at most 30 if positive, not 51, 68, 90, 100, 103, 115, 129, 158, 173, 183, 194, 227, 319, 333, 367, 389, 454, 463, 493,
  </code></pre>
  
  <p>This is part of my data:</p>
  
  <pre><code>Strategy    Last trade   P&amp;L    Age
  KBand       44939.55     20
  boll        84550.86     19
  te          84550.86     19
  RSI         126576.81    130
  bh          6321355.26   17363
  will        39294.69     17
  mae         0            0
  ichi        -12876.14    26
  cmci        76046.52     16
  tas         63197.1      11
  KBand       -33729.9     6
  ichi        6698.04      4
  MACD        6674.36      5
  ad          -26684.6     2
  will        -33332.65    7
  boll        -33299.6     40
  te          -33299.6     40
  mae         0            0
  </code></pre>