[R] [urgent]arranging data in descending order in each column
QAMAR MUHAMMAD UZAIR
d029307 at polito.it
Fri Jun 1 11:16:21 CEST 2012
Yes this is what i wanted.
thanks indeed!!!
On Fri, 1 Jun 2012 07:40:49 +0000
Ben Bolker <bbolker at gmail.com> wrote:
> 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)
>
> ?
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained,
>reproducible code.
More information about the R-help
mailing list