title: Sort matrix according to first column in R
body: <p>I have a matrix with two columns of the following form:</p>
  
  <pre><code>1 349
  1 393
  1 392
  4 459
  3 49
  3 32
  2 94
  </code></pre>
  
  <p>I would like to sort this matrix in increasing order based on the first column but I would like to keep the corresponding values in the second column.</p>
  
  <p>The output would look like this:</p>
  
  <pre><code>1 349
  1 393
  1 392
  2 94
  3 49
  3 32
  4 459
  </code></pre>