title: Sort by absolute value
body: <p>Does anyone know how to sort a vector in R by absolute value, so <code>(-2, 3, 1) -&gt; (1, -2, 3)</code> etc?</p>
  
  <p>If I were doing it in python I'd create a pair of every value and its sign, sort the list of pairs by the absolute value then reapply the sign, but I'm very new to R so have no idea how to do this.</p>
  
  <p>Cheers</p>