[R] Sort an array

Mark Knecht markknecht at gmail.com
Mon Sep 7 23:41:01 CEST 2009


?order

Possibly something like

A = A[order(A$Field1, A$Field2),]

On Mon, Sep 7, 2009 at 3:22 AM, OLIVIER REGNIER-COUDERT
(0509785)<o.regnier-coudert at rgu.ac.uk> wrote:
>  Hi,
>
> Would anybody know how to sort an array in order?
>
> I basically store the results from an analysis in an array and would like to organise it at the end of my loop with the lowest result at the index 1 and the highest result at the last index.
>
> Thanks.
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> 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