Detect Outliers using IQR Method
detect_outliers_iqr.RdIdentifies outliers using the interquartile range (IQR) method. Values beyond Q1 - multiplierIQR or Q3 + multiplierIQR are flagged.
Examples
data <- data.frame(x = c(1:20, 100))
detect_outliers_iqr(data, variable = "x")
#> x is_outlier
#> 1 1 FALSE
#> 2 2 FALSE
#> 3 3 FALSE
#> 4 4 FALSE
#> 5 5 FALSE
#> 6 6 FALSE
#> 7 7 FALSE
#> 8 8 FALSE
#> 9 9 FALSE
#> 10 10 FALSE
#> 11 11 FALSE
#> 12 12 FALSE
#> 13 13 FALSE
#> 14 14 FALSE
#> 15 15 FALSE
#> 16 16 FALSE
#> 17 17 FALSE
#> 18 18 FALSE
#> 19 19 FALSE
#> 20 20 FALSE
#> 21 100 TRUE