Re: [R] Order a matrix

2011-05-24 Thread Lisa
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.

Re: [R] Order a matrix

2011-05-24 Thread William Dunlap
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

Re: [R] order a matrix

2007-11-05 Thread Christian Hennig
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

Re: [R] order a matrix

2007-11-05 Thread Prof Brian Ripley
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