Re: [R] sort (all columns of) a matrix

2009-10-08 Thread Bert Gunter
Iverson; Kajan Saied; r-help@r-project.org Subject: RE: [R] sort (all columns of) a matrix > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Bert Gunter > Sent: Thursday, October 08, 2009 11:41 AM > To: 'Erik Iv

Re: [R] sort (all columns of) a matrix

2009-10-08 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of William Dunlap > Sent: Thursday, October 08, 2009 12:01 PM > To: Bert Gunter; Erik Iverson; Kajan Saied; r-help@r-project.org > Subject: Re: [R] sort (all co

Re: [R] sort (all columns of) a matrix

2009-10-08 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Bert Gunter > Sent: Thursday, October 08, 2009 11:41 AM > To: 'Erik Iverson'; 'Kajan Saied'; r-help@r-project.org > Subject: Re: [R] sort (a

Re: [R] sort (all columns of) a matrix

2009-10-08 Thread Bert Gunter
..@r-project.org] > On Behalf Of Kajan Saied > Sent: Thursday, October 08, 2009 11:51 AM > To: r-help@r-project.org > Subject: [R] sort (all columns of) a matrix > > Dear R-Help Team, > > I have been trying to sort (all columns of) a matrix: > > > a<-matr

Re: [R] sort (all columns of) a matrix

2009-10-08 Thread Daniel Malter
sendet: Thursday, October 08, 2009 12:51 PM An: r-help@r-project.org Betreff: [R] sort (all columns of) a matrix Dear R-Help Team, I have been trying to sort (all columns of) a matrix: > a<-matrix(a<-c(1,3,4,6,6,4,6,56,4,64,86,39,4,2),length(a),2) > a [,1] [,2] [1,]11 [2,]

Re: [R] sort (all columns of) a matrix

2009-10-08 Thread Henrique Dallazuanna
Try this: a[order(a[,1], a[,2]),] On Thu, Oct 8, 2009 at 1:50 PM, Kajan Saied wrote: > Dear R-Help Team, > > I have been trying to sort (all columns of) a matrix: > >> a<-matrix(a<-c(1,3,4,6,6,4,6,56,4,64,86,39,4,2),length(a),2) >> a >      [,1] [,2] >  [1,]    1    1 >  [2,]    3    3 >  [3,]  

Re: [R] sort (all columns of) a matrix

2009-10-08 Thread Erik Iverson
roject.org] > On Behalf Of Kajan Saied > Sent: Thursday, October 08, 2009 11:51 AM > To: r-help@r-project.org > Subject: [R] sort (all columns of) a matrix > > Dear R-Help Team, > > I have been trying to sort (all columns of) a matrix: > > > a<-matrix(a<

Re: [R] sort (all columns of) a matrix

2009-10-08 Thread Don McKenzie
Untested, but a.sorted <- apply(a,sort,2) ? Kajan Saied wrote: Dear R-Help Team, I have been trying to sort (all columns of) a matrix: a<-matrix(a<-c(1,3,4,6,6,4,6,56,4,64,86,39,4,2),length(a),2) a [,1] [,2] [1,]11 [2,]33 [3,]44 [4,]66 [5,]6

[R] sort (all columns of) a matrix

2009-10-08 Thread Kajan Saied
Dear R-Help Team, I have been trying to sort (all columns of) a matrix: > a<-matrix(a<-c(1,3,4,6,6,4,6,56,4,64,86,39,4,2),length(a),2) > a [,1] [,2] [1,]11 [2,]33 [3,]44 [4,]66 [5,]66 [6,]44 [7,]66 [8,] 56 56 [9,]4