R/remove_outliers.R
remove_outliers.Rd
This simple function uses boxplot.stats() to determine outliers and removes them from the vector.
boxplot.stats()
remove_outliers(x, coef = 1.5)
a vector of values
a multiple of the IQR that is allowed at maximum to keep values within the accepted range
remove_outliers(c(1,2,1,2,1,2,8)) #> 1 outlier removed #> [1] 1 2 1 2 1 2 remove_outliers(c(1,2,1,2,1,2)) #> 0 outliers removed #> [1] 1 2 1 2 1 2