Re: [R] Order all the columns ascending elements on a matrix or a data frame

2012-06-11 Thread Trying To learn again
gt; > Thanks, > > A.K. > > > > > > > > > > - Original Message - > > From: Bert Gunter > > To: arun > > Cc: Trying To learn again ; R help < > r-help@r-project.org> > > Sent: Sunday, June 10, 2012 4:47 PM > >

Re: [R] Order all the columns ascending elements on a matrix or a data frame

2012-06-10 Thread arun
learn again ; R help Sent: Sunday, June 10, 2012 4:47 PM Subject: Re: [R] Order all the columns ascending elements on a matrix or a data frame Inline ... -- Bert On Sun, Jun 10, 2012 at 10:46 AM, arun wrote: > Hi, > > If your intention is to order the first column by ascending, then by 2

Re: [R] Order all the columns ascending elements on a matrix or a data frame

2012-06-10 Thread Bert Gunter
6042094 15.11878 >>  [6,] 5.164754 0.6294328 15.12397 >>  [7,] 5.243715 0.6316685 15.15643 >>  [8,] 5.287891 0.7910043 15.16424 >>  [9,] 5.369162 0.9218145 15.18380 >> [10,] 5.797640 0.9608231 15.18877 >> >> Here, the all columns are sorted to ascending, bu

Re: [R] Order all the columns ascending elements on a matrix or a data frame

2012-06-10 Thread Bert Gunter
t; > > > ----- Original Message - > From: Trying To learn again > To: r-help@r-project.org > Cc: > Sent: Sunday, June 10, 2012 2:36 AM > Subject: [R] Order all the columns ascending elements on a matrix or a data > frame > > Imagine I have a csv KT.csv > > I

Re: [R] Order all the columns ascending elements on a matrix or a data frame

2012-06-10 Thread arun
lem is that the corresponding elements in each of the rows in the original dataset has also changed. A.K. - Original Message - From: Trying To learn again To: r-help@r-project.org Cc: Sent: Sunday, June 10, 2012 2:36 AM Subject: [R] Order all the columns ascending elements on a mat

Re: [R] Order all the columns ascending elements on a matrix or a data frame

2012-06-10 Thread Özgür Asar
Try apply(b,2,sort) best ozgur -- View this message in context: http://r.789695.n4.nabble.com/Order-all-the-columns-ascending-elements-on-a-matrix-or-a-data-frame-tp4632922p4632924.html Sent from the R help mailing list archive at Nabble.com. __ R-he

[R] Order all the columns ascending elements on a matrix or a data frame

2012-06-10 Thread Trying To learn again
Imagine I have a csv KT.csv I want to create a new dataframe o convert KT in a matrix and create a new matrix with each column of KT ordered by ascending order. I have tried to make this b<-read.csv("KT.csv") for(i in 1:ncol(b)){ b[,i]<-sort(b[,i]) } But it puts a message that the number of