title: rank and order in R
body: <p>i am having trouble understanding the difference between the R function <code>rank</code> and the R function <code>order</code>.  they seem to produce the same output:</p>
  
  <pre><code>&gt; rank(c(10,30,20,50,40))
  [1] 1 3 2 5 4
  &gt; order(c(10,30,20,50,40))
  [1] 1 3 2 5 4
  </code></pre>
  
  <p>Could somebody shed some light on this for me?
  Thanks </p>