outlier_zscore_plot: Outliers: Z-score method plot

Description Usage Arguments Value See Also Examples

View source: R/outliers.R

Description

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

Usage

1
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

1
2
3
4
5
6
7
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 June 9, 2021, 9:06 a.m.