top3mean: Mean Of 3 Highest Values

View source: R/top3mean.R

top3meanR Documentation

Mean Of 3 Highest Values

Description

This function returns the mean of the top3 highest values.

Usage

top3mean(x, silent = FALSE, debug = FALSE, callFrom = NULL)

Arguments

x

(numeric vector) main input

silent

(logical) suppress messages

debug

(logical) additional messages for debugging

callFrom

(character) allows easier tracking of messages produced

Details

Generally, NA will be excluded, if all values are NA this finction will return NULL ; thus, in case of (entirely) unsuitable data (non-numeric ...) NULL will be returned. If data has subgroups you may try a tapply -way.

Value

This function returns a vector with single numeric value for mean of top3 ( returns NULL with invalid input or if all input is NA)

See Also

mean

Examples

x1 <- c(15:11,NA,16)
top3mean(x1)

wrMisc documentation built on April 3, 2025, 8:17 p.m.