Learn R Programming

amp.dm (version 0.2.0)

flag_outliers: Creates a flag for outlying values

Description

This function creates a flag identifying the outliers in a vector

Usage

flag_outliers(var, type = "boxstat")

Value

a numeric vector the same length as var with either 0 (no outlier) or 1 (outlier)

Arguments

var

numeric vector that should be checked for outliers

type

character with the type of test to perform for outliers (currently only the "boxstats" is available that uses the boxplot method)

Author

Richard Hooijmaijers

Examples

Run this code

dfrm <- data.frame(a = 1:10, b = c(1:9,50))
flag_outliers(dfrm$a)
flag_outliers(dfrm$b)

Run the code above in your browser using DataLab