ggstatsplot (version 0.0.12)

outlier_df: Adding a column to dataframe describing outlier status.

Description

This function is mostly helpful for internal operations of some of the functions in this package.

Usage

outlier_df(data, x, y, outlier.label, outlier.coef = 1.5, ...)

Arguments

data

A dataframe (or a tibble) from which variables specified are to be taken. A matrix or tables will not be accepted.

x

The grouping variable from the dataframe data.

y

The response (a.k.a. outcome or dependent) variable from the dataframe data.

outlier.label

Label to put on the outliers that have been tagged.

outlier.coef

Coefficient for outlier detection using Tukey's method. With Tukey's method, outliers are below (1st Quartile) or above (3rd Quartile) outlier.coef times the Inter-Quartile Range (IQR) (Default: 1.5).

...

Additional arguments.

Examples

Run this code
# NOT RUN {
# adding column for outlier and a label for that outlier
ggstatsplot:::outlier_df(
  data = morley,
  x = Expt,
  y = Speed,
  outlier.label = Run,
  outlier.coef = 2
) %>%
  dplyr::arrange(outlier)
# }

Run the code above in your browser using DataCamp Workspace