Skip to content
Prev 244505 / 398503 Next

order matrix by column position

On Thu, Dec 9, 2010 at 5:24 PM, Folkes, Michael
<Michael.Folkes at dfo-mpo.gc.ca> wrote:
Try this:

ix <- 1:3
results[do.call(order, as.data.frame(results)[ix]), ]

as.data.frame can optionally be omitted if the results object is
already a data frame (in your example code its a matrix).