title: Sort rows of data frame by shifting the rows so that the maximum value is on the top
body: <p>I have a data frame like below, values of which needs to be sorted. </p>
  
  <pre><code>Name Bin Value
  a    1   10
  a    2   1000
  a    3   1
  a    4   100
  b    1   20
  b    2   2
  b    3   200
  b    4   2000
  </code></pre>
  
  <p>I wish that the maximum value goes to the top with keeping the relative position of values to the other values, so that the new order looks like below.</p>
  
  <pre><code>Name Bin Value
  a    1   1000
  a    2   1
  a    3   100
  a    4   10
  b    1   2000
  b    2   20
  b    3   2
  b    4   200
  </code></pre>
  
  <p>It is not just bring the maximum <code>Value</code> to the top, but the whole sequence of <code>Value</code> needs to be shifted with maximum <code>Value</code> like <code>a</code> <code>1</code> is always below <code>a</code> <code>1000</code> in both old and new <code>data.frame</code>.</p>