Skip to contents

This function will flag outlier wells based the median_wormlength_um for wells.

Usage

outlierWF(data, ..., iqr = TRUE, thresh = NULL, filterWF = TRUE)

Arguments

data

A data frame output from the summarizeWellsfunction or any of the WF functions.

...

<[`dynamic-dots`][rlang::dyn-dots]> Variable(s) used to group the well summarized data. Variable names in data are supplied separated by commas and without quotes. The outliers will be detected across the wells within the group specified.

iqr

Logical, if TRUE, wells in a group are called outliers if the well median_wormlength_um is outside the range median(median_wormlength_um) +/- (thresh * IQR). If FALSE, wells in a group are called outliers if the well median_wormlength_um is outside the range mean(median_wormlength_um) +/- (thresh * SD). The default is TRUE. NOTE: The Interquartile Range (IQR) method is useful for most distributions. The Standard Deviation (SD) method should only be applied to normal distributions.

thresh

A numeric value used to calculate outliers. By default this parameter is set to NULL. If thresh = NULL then it is set to the recommended values within the function: (1.5 if iqr = TRUE) and (3 if iqr = FALSE).

filterWF

Logical, if TRUE any flagged wells detected in data are not considered for the calculation of outliers.

Value

A single data frame identical to the input data with the outlier_WellFlag variable added. The outlier_WellFlag variable is coded as "outlier" for objects deemed outliers and NA_character_ for non-outliers.