View source: R/remove_outliers.R
remove_outliers | R Documentation |
Removes outliers based on their distance from the inter-quartile range (IQR).
Excludes all points beyond coef
times the IQR. The function uses the
command boxplot.stats()
which uses the Tukey's method to identify the
outliers ranged above and below the coef*
IQR.
remove_outliers(vec, coef = 1.5)
vec |
A vector of numeric values |
coef |
A number specifying the maximum distance from the
inter-quartile range of |
A vector of numeric values of length length(vec)
with all
elements identical as in vec
except that outliers are replaced by NA.
## Not run:
vec <- remove_outliers( vec, coef=3 )
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.