R/gx.fractile.R

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

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.