outlier: Find value with largest difference from the mean
Description
Finds value with largest difference between it and sample mean, which can be an outlier.
Usage
outlier(x, opposite = FALSE, logical = FALSE)
Arguments
x
a data sample, vector in most cases. If argument is a dataframe, then outlier is calculated for
each column by sapply. The same behavior is applied by apply when the matrix is given.
opposite
if set to TRUE, gives opposite value (if largest value has maximum difference
from the mean, it gives smallest and vice versa)
logical
if set to TRUE, gives vector of logical values, and possible outlier position
is marked by TRUE
Value
A vector of value(s) with largest difference from the mean.