Skip to contents

Applies detect_outliers() to every numeric column and tabulates the result.

Usage

outlier_summary(df, types = NULL, method = "iqr")

Arguments

df

A data frame.

types

Optional named character vector of column types.

method

Outlier method passed to detect_outliers().

Value

A list with per_column (a data frame of column, n_outliers, pct) and overall_rate (fraction of numeric cells flagged, 0-1), or NULL if there are no numeric columns.

Examples

outlier_summary(iris)
#> $per_column
#>         column n_outliers  pct
#> 1 Sepal.Length          0 0.00
#> 2  Sepal.Width          4 2.67
#> 3 Petal.Length          0 0.00
#> 4  Petal.Width          0 0.00
#> 
#> $method
#> [1] "iqr"
#> 
#> $overall_rate
#> [1] 0.006666667
#>