View source: R/removeOutliers.R
removeOutliers | R Documentation |
Remove data outliers based on the interquartile range.
removeOutliers(x, k = 1.5)
x |
vector of data. |
k |
factor to applied to the interquartile range (default = 1.5). |
The interquartile range IQR is computed from input dataset as IQR = Q3 - Q1, where Q1 is 25th percentile and Q3 is the 75th percentile. Values larger than Q3 + k * IQR and smaller than Q1 - k * IQR are deemed as outliers and substituted with NA's.
The default value of k is 1.5.
A numeric vector with the same length as input vector.
mydata <- c(-10 * runif(10), runif(10))
removeOutliers(mydata)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.