[R] [urgent]arranging data in descending order in each column

Ben Bolker bbolker at gmail.com
Fri Jun 1 09:40:49 CEST 2012


QAMAR MUHAMMAD UZAIR <d029307 <at> polito.it> writes:

> 
> Dear R users,
> 
> I have data in the following manner
> 
> [,1]	[,2]	[,3]	[,4]
> 6	2	2	2
> 5	4	4	3

 [snip]

> I want to arrange all the data in descending order. I have
> 92 columns in my actual data set. It is therefore
> difficult for me to apply order command to each column. Is
> there a short way of doing it?

  Do you mean

apply(mydata,2,sort,decreasing=TRUE)

 ?



More information about the R-help mailing list