outlier | R Documentation |
Finds value with largest difference between it and sample mean, which can be an outlier.
outlier(x, opposite = FALSE, logical = FALSE)
x |
a data sample, vector in most cases. If argument is a dataframe, then outlier is calculated for
each column by |
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 |
A vector of value(s) with largest difference from the mean.
Lukasz Komsta, corrections by Markus Graube
rm.outlier
set.seed(1234) y=rnorm(100) outlier(y) outlier(y,opposite=TRUE) dim(y) <- c(20,5) outlier(y) outlier(y,opposite=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.