| is_outlier | R Documentation |
Detect outliers using MAD (Median Absolute Deviation)
is_outlier(
x,
nmads = 2.5,
constant = 1.4826,
type = c("both", "lower", "higher")
)
x |
Numeric vector. |
nmads |
Number of MADs from the median to define the boundaries for outliers.
Default is |
constant |
Constant factor to convert the MAD to a standard deviation.
Default is |
type |
Type of outliers to detect.
Available options are |
Numeric vector of indices indicating the positions of outliers in x.
x <- c(1, 2, 3, 4, 5, 100)
is_outlier(x) # returns 6
x <- c(3, 4, 5, NA, 6, 7)
is_outlier(x, nmads = 1.5, type = "lower") # returns 4
x <- c(10, 20, NA, 15, 35)
is_outlier(x, nmads = 2, type = "higher") # returns 3, 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.