From: Erik Iverson <>
Date: Mon, 10 Mar 2008 16:03:49 -0500

Here's an example. See ?order

mt <- matrix(sample(1:20), ncol = 2)

Erik Iverson

ermimi wrote:
> I have a matrix with 2 columns and n row. I need sort the matrix by the first
> column but the second row must be sort in the same order that the first
> column. Somebody know how I can sort this matrix.
> Thanks very much mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Mon 10 Mar 2008 - 21:06:22 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 10 Mar 2008 - 21:30:21 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive