title: Sorting in R by two columns
body: <p>I'm trying to sort using two columns in R. This is my code.</p>
  
  <pre><code>options(max.print=1000000)
  data &lt;- read.table("u.data",header=TRUE)
  data&lt;-data[,-4]
  data&lt;-data[order(user,movie),]
  </code></pre>
  
  <p>I'm getting the following error -
  Error in order(user) : object 'user' not found</p>
  
  <p>A 10 row view of my table is as follows</p>
  
  <pre><code>&gt; data[1:10,]
     user movie rate
  1   196   242    3
  2   186   302    3
  3    22   377    1
  4   244    51    2
  5   166   346    1
  6   298   474    4
  7   115   265    2
  8   253   465    5
  9   305   451    3
  10    6    86    3
  </code></pre>