R/trimAboveMean.R

trimAboveMean <-
function (x, trim = 0.1) {
    qx <- quantile(x, probs = 1 - trim, names = FALSE, na.rm = TRUE)
    x[x >= qx] <- as.numeric(NA)
    mean(x, na.rm = TRUE)
}

Try the JMbayes package in your browser

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

JMbayes documentation built on Jan. 9, 2020, 9:07 a.m.