powered by
This function creates a flag identifying the outliers in a vector
flag_outliers(var, type = "boxstat")
a numeric vector the same length as var with either 0 (no outlier) or 1 (outlier)
var
numeric vector that should be checked for outliers
character with the type of test to perform for outliers (currently only the "boxstats" is available that uses the boxplot method)
Richard Hooijmaijers
dfrm <- data.frame(a = 1:10, b = c(1:9,50)) flag_outliers(dfrm$a) flag_outliers(dfrm$b)
Run the code above in your browser using DataLab