outlier_zscore_plot: Outliers: Z-score method plot

View source: R/outliers.R

outlier_zscore_plotR Documentation

Outliers: Z-score method plot

Description

Test several Z-score thresholds to visualize outliers. Tidyverse friendly.

Usage

outlier_zscore_plot(df, var, group = NULL, thresh = c(2, 3, 5), top = 5)

Arguments

df

Dataframe.

var

Numeric variable.

group

Categorical variable. Grouping variable.

thresh

Numeric vector. Z-Score threshold for n standard deviations.

top

Integer. Show only n most frequent categorical values when using the group argument.

Value

ggplot2 object

See Also

Other Outliers: outlier_turkey(), outlier_zscore(), winsorize()

Examples

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"))

lares documentation built on Nov. 5, 2023, 1:09 a.m.