R/gx.quantile.R

gx.quantile <-
function (xx, f, display = TRUE) 
{
    temp.x <- remove.na(xx)
    x <- sort(temp.x$x[1:temp.x$n])
    pr <- (rank(x) - 0.5)/temp.x$n
    q <- signif(approx(pr, x, f)$y, 4)
    if (display) 
        cat("  Fractile for", deparse(substitute(xx)), "=", f, 
            "\n  Quantile =", q, "\n")
    invisible(list(q = q))
}

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.