Re: [R] sort columns

2010-02-26 Thread Ista Zahn
Hi Frederik, Not exactly clear how you want them sorted, but one of these two is probably what you want: mat <- matrix(100:1, ncol=10) mat.1 <- apply(mat, 2, sort) mat.2 <- mat[order(10:1),] Best, Ista On Fri, Feb 26, 2010 at 12:41 PM, frederik vanhaelst wrote: > Hello, > > i have a 50*100 mat

Re: [R] sort columns

2010-02-26 Thread Henrique Dallazuanna
Try this: apply(m, 2, sort) On Fri, Feb 26, 2010 at 2:41 PM, frederik vanhaelst wrote: > Hello, > > i have a 50*100 matrix, with real numbers. How do i sort each column? > Now i sort it with a for-loop but this take a lot of time... > > Thank you, > > Frederik > >        [[alternative HTML versi

[R] sort columns

2010-02-26 Thread frederik vanhaelst
Hello, i have a 50*100 matrix, with real numbers. How do i sort each column? Now i sort it with a for-loop but this take a lot of time... Thank you, Frederik [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://st