[R] SORT MATRIX

Gabor Csardi csardi at rmki.kfki.hu
Mon Mar 10 22:24:25 CET 2008


M[ order(M[,1]), ]

G.

On Mon, Mar 10, 2008 at 01:56:45PM -0700, 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
> -- 
> View this message in context: http://www.nabble.com/SORT-MATRIX-tp15955823p15955823.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Csardi Gabor <csardi at rmki.kfki.hu>    UNIL DGM



More information about the R-help mailing list