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
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
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
3 matches
Mail list logo