title: Order function in R: argument lengths differ
body: <p>I'm getting the following error in R:</p>
  
  <pre><code>argument lengths differ.
  </code></pre>
  
  <p>I have a data set I would like to order on two columns, first on caseID, then on a column that contains a timestamp. I use the following code:</p>
  
  <pre><code>mydata &lt;- mydata[order(mydata[ ,col1], mydata[ ,col2], decreasing = FALSE),]
  </code></pre>
  
  <p>Col1 and col2 are two variables holding an integer. I have looked at similar questions and tried the solutions that were proposed there, but nothing worked ;).</p>
  
  <p>Could someone please help me?</p>
  
  <p>Kind regards</p>