Hi, Bill,
Thank you for your help. Your R script works very well.
Lisa
--
View this message in context:
http://r.789695.n4.nabble.com/Order-a-matrix-tp3547923p3548017.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.
Try using do.call("order", listOfColumnsToSortBy), as in
cols <- c(1,3,4)
x[do.call("order", as.data.frame(x[,cols])), ]
To be really safe you should remove the names from the data.frame
produced by as.data.frame (in case they match the argument names
of order), as in
x[do.call("order", unna
That solved it!
Thank you very much!
On Mon, 5 Nov 2007, Prof Brian Ripley wrote:
> On Mon, 5 Nov 2007, Christian Hennig wrote:
>
>> Dear list,
>>
>> order(x,y,z) returns a permutation to order x, ties broken by y, remaining
>> ties broken by z. (And so on.)
>>
>> What I'd like to do is
>> ord
On Mon, 5 Nov 2007, Christian Hennig wrote:
> Dear list,
>
> order(x,y,z) returns a permutation to order x, ties broken by y, remaining
> ties broken by z. (And so on.)
>
> What I'd like to do is
> order(X), where X is a matrix (or a list or data frame if necessary) of
> unspecified size, which or
4 matches
Mail list logo