Description Usage Arguments Details Value Author(s) See Also Examples
Takes in a vector, and returns count and index of outliers
1 |
vector |
an integer or numeric vector |
The function uses the same criteria to identify outliers as the one used for box plots. All values that are greater than 75th percentile value + 1.5 times the inter quartile range or lesser than 25th percentile value - 1.5 times the inter quartile range, are tagged as outliers.
The individual elements (number of outliers and index of outliers) of the two element output list can be picked using the code given in example. The index of outliers can be used to get a vector of all outliers.
a list with two elements: count and index of outliers
Akash Jain
1 2 3 4 5 6 7 8 9 | # Scores vector
scores <- c(1, 4, 7, 10, 566, 21, 25, 27, 32, 35,
49, 60, 75, 23, 45, 86, 26, 38, 34, 223, -3)
# Identify the count of outliers and their index
ltOutliers <- outliers(vector = scores)
numOutliers <- ltOutliers$numOutliers
idxOutliers <- ltOutliers$idxOutliers
valOutliers <- scores[idxOutliers]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.