
Test several Z-score thresholds to visualize outliers. Tidyverse friendly.
outlier_zscore_plot(df, var, group = NULL, thresh = c(2, 3, 5), top = 5)
ggplot2 object
Dataframe.
Numeric variable.
Categorical variable. Grouping variable.
Numeric vector. Z-Score threshold for n standard deviations.
Integer. Show only n most frequent categorical values when
using the group
argument.
Other Outliers:
outlier_tukey()
,
outlier_zscore()
,
winsorize()
Sys.unsetenv("LARES_FONT") # Temporal
data(dft) # Titanic dataset
outlier_zscore_plot(dft, Fare)
p <- outlier_zscore_plot(dft, Fare, Pclass, thresh = c(3, 5))
plot(p)
attr(p, "z_values")
head(attr(p, "labels"))
Run the code above in your browser using DataLab