R/gx.sort.R

gx.sort <-
function (x, col = 1, reverse = FALSE) 
{
    ncol <- length(x[1, ])
    if (col > ncol) 
        stop("Column number must be between 1 and", ncol, "\n\n")
    if (reverse) 
        x[rev(order(x[, col])), ]
    else x[order(x[, col]), ]
}

Try the rgr package in your browser

Any scripts or data that you put into this service are public.

rgr documentation built on May 2, 2019, 6:09 a.m.