which_outliers | R Documentation |
which_outliers
Find the outliers in a dataset
which_outliers
which_outliers(x, na.rm = TRUE, probs = c(0.5, 0.95), ...)
x |
dataset |
na.rm |
Whether ignore the na value. |
probs |
Range of non-outlier range |
... |
More options in quatile(); |
Index of the outliers
set.seed(1)
x <- rnorm(100)
x <- c(-10, x, 10)
id <- which_outliers(x, probs=c(0.05,0.95))
y = x
y[id]=NA
par(mfrow = c(1, 2))
boxplot(x, ylim=range(x))
boxplot(y, ylim=range(x))
par(mfrow=c(1,1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.