top3mean | R Documentation |
This function returns the mean of the top3 highest values.
top3mean(x, silent = FALSE, debug = FALSE, callFrom = NULL)
x |
(numeric vector) main input |
silent |
(logical) suppress messages |
debug |
(logical) additional messages for debugging |
callFrom |
(character) allows easier tracking of messages produced |
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.
This function returns a vector with single numeric value for mean of top3
( returns NULL
with invalid input or if all input is NA
)
mean
x1 <- c(15:11,NA,16)
top3mean(x1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.