Learn R Programming

aelab (version 1.1.0)

find_outlier: find_outlier

Description

Identify outliers in a numeric column using the IQR method (values outside 1.5 \(\times\) IQR from Q1/Q3).

Usage

find_outlier(df, var, other_var = NULL)

Value

A tibble with columns row_index, outlier_value, and any requested other_var columns.

Arguments

df

A data frame.

var

Name of the column to check for outliers (string).

other_var

Character vector of additional column names to return alongside the outlier values, or NULL.

Examples

Run this code
df <- data.frame(val = c(1, 2, 2, 3, 100), id = 1:5)
find_outlier(df, "val", "id")

Run the code above in your browser using DataLab