detect_outliers: Flag outliers

Description Usage Arguments

Description

Flag any values that fall outside a specified range. By default, any observation more than 1.5x the interquartile range will be tagged. The 'clip_outliers' option controls whether values outside this range will be trimmed to the appropriate max or min.

Usage

1
2
detect_outliers(df, col, outlier_threshold = 1.5,
  clip_outliers = FALSE, flag_outliers_both_directions = FALSE)

Arguments

df

The data.frame to be transformed

col

The column of interest

outlier_threshold

Values more than outlier_threshold times the interquartile range outside the interquartile range are considered outliers.

clip_outliers

If TRUE, values above or below the specified threshold will be clipped to the relevant threshold.

flag_outliers_both_directions

If TRUE, two boolean columns will be added to indicate whether the values was above or below the detection threshold.


lewinfox/fast-ai-structured documentation built on May 23, 2019, 5:03 a.m.