R/quantile.lorenz.R

Defines functions quantile.lorenz

Documented in quantile.lorenz

quantile.lorenz <-
function(x, probs = seq(0, 1, 0.25), type = c("L", "p"), ...)
{
    type <- match.arg(type)
    structure(sapply(probs, function(z) min(x[x[,type] >= z, "x"])),
        names=paste0(format(100 * probs, trim=TRUE,
        digits = max(2L, getOption("digits"))), "%"))
}

Try the opticut package in your browser

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

opticut documentation built on May 2, 2019, 5:09 a.m.